From e0c00f7694eb0bbaa0d99a45e1754c8e0f19d650 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Sat, 8 Feb 2025 08:18:34 +0000 Subject: [PATCH 1/5] move to peetry --- .github/workflows/python-app.yml | 6 ++-- .github/workflows/python-package.yml | 6 ++-- .github/workflows/python-publish.yml | 5 +++- README.md | 2 +- project.toml | 41 ++++++++++++++++++++++++++++ recipe/meta.yaml | 2 +- setup.py | 40 --------------------------- 7 files changed, 55 insertions(+), 47 deletions(-) create mode 100644 project.toml delete mode 100644 setup.py diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 7f453c0..d4b6471 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -26,8 +26,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python -m pip install flake8 pytest + pip install poetry + poetry build + pip install dist/*.whl - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index cda85d0..ba7262a 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -19,8 +19,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python -m pip install flake8 pytest + pip install poetry + poetry build + pip install dist/*.whl - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 56c133a..74b01c5 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -21,7 +21,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install build + python -m pip install flake8 pytest + pip install poetry + poetry build + pip install dist/*.whl - name: Build package run: python -m build - name: Publish package diff --git a/README.md b/README.md index 96be129..bb68a03 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Install with setup.py: ```bash $ git clone https://github.com/PRIDE-Archive/pridepy $ cd pridepy -$ python setup.py sdist bdist_wheel +$ python project.toml sdist bdist_wheel $ pip install dist/pridepy-{version}.tar.gz ``` diff --git a/project.toml b/project.toml new file mode 100644 index 0000000..f6a0ffa --- /dev/null +++ b/project.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "pridepy" +version = "0.0.7" +description = "Python Client library for PRIDE Rest API" +authors = [ + {name = "PRIDE Team", email = "pride-support@ebi.ac.uk"}, +] +readme = "README.md" +requires-python = ">=3.7" +keywords = ["PRIDE", "python", "client", "REST", "API"] +license = {text = "Apache-2.0", file = "LICENSE"} +dependencies = [ + "requests", + "ratelimit", + "click", + "pytest", + "setuptools", + "plotly", + "tqdm", + "boto3", + "botocore", + "httpx", +] + +[project.urls] +Homepage = "https://github.com/PRIDE-Archive/pridepy" + +[project.scripts] +pridepy = "pridepy:main" + +[tool.setuptools] +packages = ["pridepy"] +py-modules = ["pridepy"] + +[tool.setuptools.package-data] +"*" = ["*.txt", "*.md"] +"aspera" = ["**/*"] \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 706e89c..821242b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -19,7 +19,7 @@ requirements: host: - python >=3.9 - pip - - setuptools + - poetry-core >=1.2.0 run: - requests~=2.31.0 - ratelimit~=2.2.1 diff --git a/setup.py b/setup.py deleted file mode 100644 index 8af97a3..0000000 --- a/setup.py +++ /dev/null @@ -1,40 +0,0 @@ -import setuptools -from setuptools import setup - -with open("README.md", "r") as fh: - long_description = fh.read() - -setup( - name="pridepy", - version="0.0.7", - author="PRIDE Team", - author_email="pride-support@ebi.ac.uk", - description="Python Client library for PRIDE Rest API", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/PRIDE-Archive/pridepy", - keywords="PRIDE python client REST API", - packages=setuptools.find_packages(), - py_modules=["pridepy"], - install_requires=[ - "requests", - "ratelimit", - "click", - "pytest", - "setuptools", - "plotly", - "tqdm", - "boto3", - "botocore", - "httpx", - ], - include_package_data=True, - package_data={ - "": ["*.txt", "*.md"], # Include text or markdown files from any package - "aspera": ["**/*"], # Include all files from the aspera directory - }, - entry_points=""" - [console_scripts] - pridepy=pridepy:main - """, -) From 0b106a38f510e2a8b94ea15909a1d92c3d19165b Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Sat, 8 Feb 2025 08:21:15 +0000 Subject: [PATCH 2/5] move to poetry --- README.md | 2 +- project.toml => pyproject.toml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename project.toml => pyproject.toml (100%) diff --git a/README.md b/README.md index bb68a03..9051167 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Install with setup.py: ```bash $ git clone https://github.com/PRIDE-Archive/pridepy $ cd pridepy -$ python project.toml sdist bdist_wheel +$ python pyproject.toml sdist bdist_wheel $ pip install dist/pridepy-{version}.tar.gz ``` diff --git a/project.toml b/pyproject.toml similarity index 100% rename from project.toml rename to pyproject.toml From f177865f5ab2989051831694ac81aa7ffbe682c0 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Sat, 8 Feb 2025 08:23:30 +0000 Subject: [PATCH 3/5] move to poetry --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f6a0ffa..aa4e5db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ authors = [ readme = "README.md" requires-python = ">=3.7" keywords = ["PRIDE", "python", "client", "REST", "API"] -license = {text = "Apache-2.0", file = "LICENSE"} +license = "Apache-2.0" dependencies = [ "requests", "ratelimit", From 6a066d628266b3d081ec4b93317e43d189959efd Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Sat, 8 Feb 2025 08:33:12 +0000 Subject: [PATCH 4/5] move to poetry --- pyproject.toml | 124 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 96 insertions(+), 28 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index aa4e5db..443a20d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,41 +1,109 @@ -[build-system] -requires = ["setuptools>=45", "wheel"] -build-backend = "setuptools.build_meta" - -[project] +[tool.poetry] name = "pridepy" version = "0.0.7" description = "Python Client library for PRIDE Rest API" authors = [ - {name = "PRIDE Team", email = "pride-support@ebi.ac.uk"}, + "PRIDE Team ", +] +maintainers = [ + "PRIDE Team ", ] readme = "README.md" -requires-python = ">=3.7" -keywords = ["PRIDE", "python", "client", "REST", "API"] license = "Apache-2.0" -dependencies = [ - "requests", - "ratelimit", - "click", - "pytest", - "setuptools", - "plotly", - "tqdm", - "boto3", - "botocore", - "httpx", +keywords = [ + "PRIDE", + "proteomics", + "mass-spectrometry", + "API", + "big data", + "bioinformatics", + "data science", +] +classifiers = [ + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Topic :: Scientific/Engineering :: Bio-Informatics", + "Development Status :: 5 - Production/Stable" +] +packages = [ + { include = "pridepy" } +] +include = [ + "LICENSE", + "README.md", + "**/*.txt", + "**/*.md", + "aspera/**/*" ] -[project.urls] -Homepage = "https://github.com/PRIDE-Archive/pridepy" +[tool.poetry.dependencies] +python = "^3.7" +requests = "^2.31.0" +ratelimit = "^2.2.1" +click = "^8.1.7" +plotly = "^5.18.0" +tqdm = "^4.66.1" +boto3 = "^1.34.0" +botocore = "^1.34.0" +httpx = "^0.27.0" -[project.scripts] +[tool.poetry.group.dev.dependencies] +pytest = "^8.0.0" +black = "^24.1.0" +isort = "^5.13.0" +pytest-cov = "^4.1.0" +mypy = "^1.8.0" + +[tool.poetry.urls] +PyPI = "https://pypi.org/project/pridepy/" +PRIDE = "https://www.ebi.ac.uk/pride/archive/" +Documentation = "https://github.com/PRIDE-Archive/pridepy#readme" +Repository = "https://github.com/PRIDE-Archive/pridepy" +License = "https://github.com/PRIDE-Archive/pridepy/LICENSE" + +[tool.poetry.scripts] pridepy = "pridepy:main" -[tool.setuptools] -packages = ["pridepy"] -py-modules = ["pridepy"] +[tool.black] +line-length = 99 +target-version = ["py39"] +include = '\.pyi?$' +extend-exclude = ''' +# A regex preceded with ^/ will apply only to files and directories +# in the root of the project. +^/tests/ +''' + +[tool.isort] +profile = "black" +multi_line_output = 3 +line_length = 99 +include_trailing_comma = true +force_grid_wrap = 0 +use_parentheses = true +ensure_newline_before_comments = true -[tool.setuptools.package-data] -"*" = ["*.txt", "*.md"] -"aspera" = ["**/*"] \ No newline at end of file +[tool.mypy] +python_version = "3.9" +warn_return_any = true +warn_unused_configs = true +disallow_untyped_defs = true +disallow_incomplete_defs = true +check_untyped_defs = true +disallow_untyped_decorators = false +no_implicit_optional = true +warn_redundant_casts = true +warn_unused_ignores = true +warn_no_return = true +warn_unreachable = true + +[build-system] +requires = ["poetry-core>=1.2.0"] +build-backend = "poetry.core.masonry.api" \ No newline at end of file From 1e3b4c85fdddfdf9efb1d4f0c93ef152b2ba6896 Mon Sep 17 00:00:00 2001 From: Yasset Perez-Riverol Date: Sat, 8 Feb 2025 08:36:56 +0000 Subject: [PATCH 5/5] Update README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9051167..a8362de 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Install with setup.py: ```bash $ git clone https://github.com/PRIDE-Archive/pridepy $ cd pridepy -$ python pyproject.toml sdist bdist_wheel +$ poetry build $ pip install dist/pridepy-{version}.tar.gz ```