From 0fabfaa33e47f44fdc4bcfc3d1a380a1e7902d7f Mon Sep 17 00:00:00 2001 From: Mikita Kuzniatsou Date: Tue, 19 Mar 2024 02:37:15 +0400 Subject: [PATCH] missed dependency fix, doc fix --- README.MD | 2 +- codegen/README.MD | 4 ++-- pyproject.toml | 4 ++-- setup.py | 9 +++++++-- tests/test_cli.py | 16 ++++++++-------- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/README.MD b/README.MD index ff814e0..c797898 100644 --- a/README.MD +++ b/README.MD @@ -29,7 +29,7 @@ pip install graphql-dataclass To generate the code execute the following command: ``` -pgmcodegen generate ./pathToOutputFolder -apiArgs .//generatorArgs.json +gqldataclass generate ./pathToOutputFolder -apiArgs .//generatorArgs.json ``` This command requires a json file containing the parameters needed to get the GraphQL schema diff --git a/codegen/README.MD b/codegen/README.MD index 3bd11a0..54f1e32 100644 --- a/codegen/README.MD +++ b/codegen/README.MD @@ -87,7 +87,7 @@ _generate_code_ function will create the following python files containing the G Example of schema retrieval command: ``` -pgmcodegen download ./cmd_output/Github/schema.json -apiArgs ./downloaderArgs.json +gqldataclass download ./cmd_output/Github/schema.json -apiArgs ./downloaderArgs.json ``` This command will create the file in _./cmd_output/Github/schema.json_ containing the schema in json version using the [information](#json-args-file) given in _./downloaderArgs.json_. @@ -101,7 +101,7 @@ A few examples can be seen [here](https://github.com/nikikuzi/graphql-dataclass/ Classes can be generated alternatively using the CLI command: ``` -pgmcodegen generate ./gdbc -apiArgs ./generatorArgs.json -v +gqldataclass generate ./gdbc -apiArgs ./generatorArgs.json -v ``` This command will generate python files in _./gdbc/_ relative folder using the [information](#json-args-file) given in _./generatorArgs.json_. diff --git a/pyproject.toml b/pyproject.toml index 8acfd0e..02649c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,8 +5,8 @@ build-backend = "setuptools.build_meta" [project] name = "graphql-dataclass" authors = [ - { name="Alex Dap", email="shlisi2017@gmail.com" }, { name="Mikita Kuzniatsou", email="nikikuzi@gmail.com" }, + { name="Alex Dap", email="shlisi2017@gmail.com" }, ] readme = "README.md" keywords = ["python", "graphql", "mapping", "dataclass"] @@ -20,7 +20,7 @@ classifiers = [ dynamic = ["version", "description"] [project.scripts] -pgmcodegen = "codegen.__main__:main" +gqldataclass = "codegen.__main__:main" [project.urls] "Homepage" = "https://github.com/nikikuzi/graphql-dataclass/" diff --git a/setup.py b/setup.py index bebc336..52c07c2 100644 --- a/setup.py +++ b/setup.py @@ -1,15 +1,20 @@ from setuptools import setup +from pathlib import Path +this_directory = Path(__file__).parent +long_description = (this_directory / "README.md").read_text() setup( name='gqldataclass', version='1.0.0', url='https://github.com/nikikuzi/graphql-dataclass/tree/1.0.0', - author='Alex Dap, Mikita Kuzniatsou', - author_email='shlisi2017@gmail.com, nikikuzi@gmail.com', + author='Mikita Kuzniatsou, Alex Dap', + author_email='nikikuzi@gmail.com, shlisi2017@gmail.com', description='A python library to generate dataclasses for GraphQL types', + long_description=long_description, include_package_data=True, packages=['pygqlmap', 'pygqlmap.src', 'codegen', 'codegen.src', 'codegen.src.templates'], data_files=[('', ['pygqlmap/config.ini'])], + install_requires=['clean-py==0.5'], python_requires='>=3.10', classifiers=[ 'Intended Audience :: Developers', diff --git a/tests/test_cli.py b/tests/test_cli.py index 548c010..9d3a6e2 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -41,7 +41,7 @@ def test_generate_cmd_gh_file(self): def run_download_cmd_ra_file_rel(): logger.debug('\nRunning run_download_cmd_ra_file_rel...') - command = "pgmcodegen download ./tests/cmd_output/rapidapi/schema.json -apiArgs ./tests/cli_input/rapid_api/downloaderArgs.json -v" #command to be executed + command = "gqldataclass download ./tests/cmd_output/rapidapi/schema.json -apiArgs ./tests/cli_input/rapid_api/downloaderArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -50,7 +50,7 @@ def run_download_cmd_ra_file_rel(): def run_generate_cmd_ra_api_abs(): logger.debug('\nRunning run_generate_cmd_ra_api_abs...') - command = "pgmcodegen generate ./tests/cmd_output/rapidapi -v -apiArgs ./tests/cli_input/rapid_api/generatorArgs.json -v" #command to be executed + command = "gqldataclass generate ./tests/cmd_output/rapidapi -v -apiArgs ./tests/cli_input/rapid_api/generatorArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -59,7 +59,7 @@ def run_generate_cmd_ra_api_abs(): def run_download_cmd_gdbc_file_rel(): logger.debug('\nRunning run_download_cmd_gh_file_rel...') - command = "pgmcodegen download ./tests/cmd_output/gdbc/schema.json -apiArgs ./tests/cli_input/gdbc_api/downloaderArgs.json -v" #command to be executed + command = "gqldataclass download ./tests/cmd_output/gdbc/schema.json -apiArgs ./tests/cli_input/gdbc_api/downloaderArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -68,7 +68,7 @@ def run_download_cmd_gdbc_file_rel(): def run_generate_cmd_gdbc_file_rel(): logger.debug('\nRunning run_generate_cmd_gdbc_file_rel...') - command = "pgmcodegen generate ./tests/cmd_output/gdbc -apiArgs tests/cli_input/gdbc_api/schema.json -v" #command to be executed + command = "gqldataclass generate ./tests/cmd_output/gdbc -apiArgs tests/cli_input/gdbc_api/schema.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -77,7 +77,7 @@ def run_generate_cmd_gdbc_file_rel(): def run_generate_cmd_gdbc_api_rel(): logger.debug('\nRunning run_generate_cmd_gdbc_api_rel...') - command = "pgmcodegen generate ./tests/cmd_output/gdbc -apiArgs ./tests/cli_input/gdbc_api/generatorArgs.json -v" #command to be executed + command = "gqldataclass generate ./tests/cmd_output/gdbc -apiArgs ./tests/cli_input/gdbc_api/generatorArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -87,7 +87,7 @@ def run_generate_cmd_gdbc_api_rel(): def run_download_cmd_gh_file_rel(): logger.debug('\nRunning run_download_cmd_gh_file_rel...') - command = "pgmcodegen download ./tests/cmd_output/github/schema.json -apiArgs ./tests/cli_input/gh_api/downloaderArgs.json -v" #command to be executed + command = "gqldataclass download ./tests/cmd_output/github/schema.json -apiArgs ./tests/cli_input/gh_api/downloaderArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -96,7 +96,7 @@ def run_download_cmd_gh_file_rel(): def run_generate_cmd_gh_api_abs(): logger.debug('\nRunning run_generate_cmd_gh_api_abs...') - command = "pgmcodegen generate ./tests/cmd_output/github -v -apiArgs ./tests/cli_input/gh_api/generatorArgs.json -v" #command to be executed + command = "gqldataclass generate ./tests/cmd_output/github -v -apiArgs ./tests/cli_input/gh_api/generatorArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command) @@ -105,7 +105,7 @@ def run_generate_cmd_gh_api_abs(): def run_generate_cmd_gh_file(): logger.debug('\nRunning run_generate_cmd_gh_api_abs...') - command = "pgmcodegen generate ./tests/cmd_output/github -v -apiArgs ./tests/cli_input/gh_api/generatorArgs.json -v" #command to be executed + command = "gqldataclass generate ./tests/cmd_output/github -v -apiArgs ./tests/cli_input/gh_api/generatorArgs.json -v" #command to be executed logger.debug("Launching: " + command) res = os.system(command)