From 8782320624cd78e12fe121771eed792710ee40b7 Mon Sep 17 00:00:00 2001 From: j00356287 Date: Thu, 10 Nov 2022 14:44:54 +0800 Subject: [PATCH] Update readme and format code Add install command from source code in readme --- README.en.md | 8 ++++++-- README.md | 6 +++++- setup.py | 2 +- test/test_compiler.py | 2 +- test/test_suite.py | 4 ++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.en.md b/README.en.md index 7214fe6..3cb9394 100644 --- a/README.en.md +++ b/README.en.md @@ -19,6 +19,10 @@ This project has been tested with test suites of SQLAlchemy. ## Installation ``` +# From pypi +>>> python -m pip install opengauss-sqlalchemy + +# From source code >>> python setup.py install ``` @@ -174,7 +178,7 @@ Table("some_table", ..., opengauss_to="GROUP group_name") ### Build python wheel ``` ->>> pip install wheel +>>> python -m pip install wheel >>> python setup.py bdist_wheel ``` @@ -188,7 +192,7 @@ Table("some_table", ..., opengauss_to="GROUP group_name") ### Steps to install and config centralized opengauss for testing 1. Add OS user for opengauss ```>>> useradd omm -g dbgrp``` -2. Change owner of opengass dir ```>>> chown omm:dbgrp ${db_dir} -R``` +2. Change owner of opengauss dir ```>>> chown omm:dbgrp ${db_dir} -R``` 3. Switch to user omm ```>>> su - omm``` 4. Install opengauss ```>>> sh install.sh -w ${db_password} -p 37200``` 5. Start opengauss ```>>> gs_ctl start -D ${db_dir}/data/single_node/``` diff --git a/README.md b/README.md index 3cf2405..63f1aad 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ ## 安装 ``` +# 从pypi安装 +>>> python -m pip install opengauss-sqlalchemy + +# 从本地源码安装 >>> python setup.py install ``` @@ -175,7 +179,7 @@ Table("some_table", ..., opengauss_to="GROUP group_name") ### 构建 python wheel格式 ``` ->>> pip install wheel +>>> python -m pip install wheel >>> python setup.py bdist_wheel ``` diff --git a/setup.py b/setup.py index c8b3eba..2d3e835 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import setup with open(os.path.join(os.path.dirname(__file__), "opengauss_sqlalchemy", "__init__.py")) as fd: VERSION = re.compile(r'.*__version__ = "(.*?)"', re.S).match(fd.read()).group(1) -long_description = (Path(__file__).parent/ "README.md").read_text() +long_description = (Path(__file__).parent / "README.md").read_text() setup( diff --git a/test/test_compiler.py b/test/test_compiler.py index 0ef2c8b..ce1ccc7 100644 --- a/test/test_compiler.py +++ b/test/test_compiler.py @@ -474,7 +474,7 @@ class DDLCompilerTest(fixtures.TestBase, AssertsCompiledSQL): ) self.assert_compile( schema.CreateTable(tbl), - "CREATE TABLE atable (id INTEGER) WITH (ORIENTATION = COLUMN) COMPRESS", + "CREATE TABLE atable (id INTEGER) WITH (ORIENTATION = COLUMN) COMPRESS", ) def test_create_table_partition_by_list(self): diff --git a/test/test_suite.py b/test/test_suite.py index a226f42..c3c295b 100644 --- a/test/test_suite.py +++ b/test/test_suite.py @@ -73,9 +73,9 @@ class LongNameBlowoutTest(_LongNameBlowoutTest): assert len(actual_name) > 255 if reflected_name is not None: - overlap = actual_name[0 : len(reflected_name)] + overlap = actual_name[0: len(reflected_name)] if len(overlap) < len(actual_name): - eq_(overlap[0:-5], reflected_name[0 : len(overlap) - 5]) + eq_(overlap[0:-5], reflected_name[0: len(overlap) - 5]) else: eq_(overlap, reflected_name) -- Gitee