From f81c5f4ccdac4ded144fb4bab0f65e0a20310e8b Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 09:04:47 -0500 Subject: [PATCH 01/10] replaced setup.cfg and setup.py completly with pyproject.toml, removed recursive packaging from test-requirements.txt and dev-requirements.txt, removed setup* from tox.ini, --- dev-requirements.txt | 4 +-- developer_docs/README.md | 3 +-- developer_docs/runtests.md | 6 ++--- pyproject.toml | 51 +++++++++++++++++++++++++++++++++-- setup.cfg | 8 ------ setup.py | 54 -------------------------------------- test-requirements.txt | 1 - tox.ini | 16 ++++++----- 8 files changed, 65 insertions(+), 78 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/dev-requirements.txt b/dev-requirements.txt index d11262ad..9c948bf9 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,4 +1,4 @@ -isort==4.3.21 +isort==5.13.2 tox wheel bumpversion @@ -6,8 +6,8 @@ twine black flake8 pylint +tomli==2.0.1 cython sphinx sphinx-rtd-theme mypy==0.770 --r requirements.txt \ No newline at end of file diff --git a/developer_docs/README.md b/developer_docs/README.md index 33d130e1..b34f3282 100644 --- a/developer_docs/README.md +++ b/developer_docs/README.md @@ -19,8 +19,7 @@ the Cromshell development environment can be set up by the following steps: python3 -mvenv venv . venv/bin/activate pip install --upgrade pip - pip install -r dev-requirements.txt - pip install -e . + pip install -e .[dev] ``` After following the above development environment setup steps, cromshell should diff --git a/developer_docs/runtests.md b/developer_docs/runtests.md index 4a6c8a39..c1fa4a70 100644 --- a/developer_docs/runtests.md +++ b/developer_docs/runtests.md @@ -14,13 +14,13 @@ as seen below tox -e lint # reformat all project files -black src tests setup.py +black src tests # sort imports in project files -isort -rc src tests setup.py +isort -rc src tests # check pep8 against all project files -flake8 src tests setup.py +flake8 src tests # lint python code for common errors and codestyle issues pylint src diff --git a/pyproject.toml b/pyproject.toml index 2f2d20b8..6038c5be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,5 @@ + +ignore_missing_imports = true [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" @@ -7,8 +9,53 @@ name = "cromshell" # Version number is automatically set via bumpversion. DO NOT MODIFY: version = "2.1.1" readme = "README.md" - +description="Command Line Interface (CLI) for Cromwell servers" +authors=[ + {name = "Jonn Smith", email = "jonn@broadinstitute.org"}, + {name = "Louis Bergelson", email = "louisb@broadinstitute.org"}, + {name = "Beri Shifaw", email = "bshifaw@broadinstitute.org"}, +] +license={text = "BSD 3-Clause"} +requires-python=">=3.7" +classifiers=[ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + ] +keywords = [ + "cromwell", "cromshell", "cromwell-cli", "cromwell-client", "cromwell-api", + "cromwell-rest", "cromwell-utilities", "cromwell-tools", +] +dynamic = ["dependencies", "optional-dependencies"] [project.urls] -"Homepage" = "https://github.com/broadinstitute/cromshell" +Homepage = "https://github.com/broadinstitute/cromshell" "Bug Tracker" = "https://github.com/broadinstitute/cromshell/issues" + +[project.scripts] +cromshell = "cromshell.__main__:main_entry" + +# Configuration for the `setuptools` package +[tool.setuptools.dynamic] +dependencies = {file = ["requirements.txt"]} +optional-dependencies = {dev = { file = ["dev-requirements.txt"]}, tests = { file = ["test-requirements.txt"]}} + +[tool.setuptools.packages.find] +where = ["src"] +include = ["src/**/*"] + +# former dump_setup.cfg configuration for mypy +[tool.mypy."numpy.*"] +ignore_missing_imports = true + +[tool.mypy."pysam.*"] +ignore_missing_imports = true + +[tool.mypy."pytest.*"] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 987a17fc..00000000 --- a/setup.cfg +++ /dev/null @@ -1,8 +0,0 @@ -[mypy-numpy.*] -ignore_missing_imports = True - -[mypy-pysam.*] -ignore_missing_imports = True - -[mypy-pytest.*] -ignore_missing_imports = True diff --git a/setup.py b/setup.py deleted file mode 100644 index c4407e65..00000000 --- a/setup.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python - -from setuptools import find_packages, setup - -with open("requirements.txt") as fh: - install_requires = fh.readlines() - -# PIPY needs a list of required packages from the test-requirements list. One of the -# lines in this file is a reference to the requirements.txt file, because PYPI will -# assume it's a package and fail; the line below will remove the requirements.txt line -# and add the extracted packages from that file to the list of required test packages. -with open("test-requirements.txt") as fh: - test_install_requires = fh.readlines() - test_install_requires.remove("-r requirements.txt") - test_install_requires.extend(install_requires) - -with open("README.md") as fh: - long_description = fh.read() - -# following src dir layout according to -# https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure - -# Version number is automatically set via bumpversion. DO NOT MODIFY: -version = "2.1.1" -setup( - name="cromshell", - version=version, - description="Command Line Interface (CLI) for Cromwell servers", - author="Jonn Smith, Louis Bergelson, Beri Shifaw", - author_email="jonn@broadinstitute.org, louisb@broadinstitute.org, " - "bshifaw@broadinstitute.org", - url="https://github.com/broadinstitute/cromshell", - license="BSD 3-Clause", - long_description=long_description, - install_requires=install_requires, - tests_require=test_install_requires, - python_requires=">=3.7", - packages=find_packages("src"), - package_dir={"": "src"}, - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - ], - entry_points={"console_scripts": ["cromshell=cromshell.__main__:main_entry"]}, - include_package_data=True, -) diff --git a/test-requirements.txt b/test-requirements.txt index c769a376..f533e277 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,4 +2,3 @@ pytest pytest-cov pytest-dependency coverage>=4.5 --r requirements.txt \ No newline at end of file diff --git a/tox.ini b/tox.ini index e3085d67..19874980 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,7 @@ ignore = E203, E501, W503 [testenv] deps = -rtest-requirements.txt + -rrequirements.txt commands = pytest tests/unit tests/integration tests/acceptance \ --cov cromshell \ @@ -28,16 +29,19 @@ setenv = [testenv:unit] deps = -rtest-requirements.txt + -rrequirements.txt commands = pytest tests/unit {posargs} [testenv:integration] deps = -rtest-requirements.txt + -rrequirements.txt commands = pytest tests/integration {posargs} [testenv:acceptance] deps = -rtest-requirements.txt + -rrequirements.txt commands = pytest tests/acceptance {posargs} @@ -49,9 +53,9 @@ deps = flake8 commands = - black --check --diff --target-version py38 src tests setup.py - isort --check-only --profile black --diff -rc tests src setup.py - flake8 src tests setup.py + black --check --diff --target-version py38 src tests + isort --check-only --profile black --diff tests src + flake8 src tests pylint --exit-zero src [testenv:lint-edit] @@ -61,9 +65,9 @@ deps = flake8 commands = - black --target-version py38 src tests setup.py - isort --profile black -rc tests src setup.py - flake8 src tests setup.py + black --target-version py38 src tests + isort --profile black tests src + flake8 src tests pylint --exit-zero src [gh-actions] From 9ffa8e43a889baaf13f89ac47c9bb01ffa074022 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 10:32:59 -0500 Subject: [PATCH 02/10] fixed pyproject.toml setuptools package find location --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 6038c5be..2ca285fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,7 @@ optional-dependencies = {dev = { file = ["dev-requirements.txt"]}, tests = { fil [tool.setuptools.packages.find] where = ["src"] -include = ["src/**/*"] +include = ["cromshell*"] # former dump_setup.cfg configuration for mypy [tool.mypy."numpy.*"] From 7cd1b04b8f3e3fb2a3242a38b4558ad9cede22a8 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 10:33:27 -0500 Subject: [PATCH 03/10] fixed dev-requirements.txt updated mypy version --- dev-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 9c948bf9..547f7ab1 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -10,4 +10,4 @@ tomli==2.0.1 cython sphinx sphinx-rtd-theme -mypy==0.770 +mypy==1.8.0 From ff9cd28d9088a449a49894387c07a1fd659c26c9 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 10:43:07 -0500 Subject: [PATCH 04/10] Removed setup.py check command, currently no integrated solution to validate pyproject.toml --- .github/workflows/pypi_packaging.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/pypi_packaging.yml b/.github/workflows/pypi_packaging.yml index 8e40f725..e30e1cc8 100644 --- a/.github/workflows/pypi_packaging.yml +++ b/.github/workflows/pypi_packaging.yml @@ -80,9 +80,6 @@ jobs: - name: Setup Env run: python3 -m pip install --upgrade pip build - - name: Validate setup.py - run: python3 setup.py check --metadata - - name: Build run: python3 -m build From 6b7bcea44845483457a62289aea9a8751ab9f96f Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 10:43:30 -0500 Subject: [PATCH 05/10] updated dev pip install in README.md --- developer_docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_docs/README.md b/developer_docs/README.md index b34f3282..e122ca1b 100644 --- a/developer_docs/README.md +++ b/developer_docs/README.md @@ -19,7 +19,7 @@ the Cromshell development environment can be set up by the following steps: python3 -mvenv venv . venv/bin/activate pip install --upgrade pip - pip install -e .[dev] + pip install -e . -r dev-requirements.txt ``` After following the above development environment setup steps, cromshell should From 83e711c668d5ad2ad36b7e4213438a36a514c856 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 10:56:53 -0500 Subject: [PATCH 06/10] minor formatting updates --- developer_docs/README.md | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/developer_docs/README.md b/developer_docs/README.md index e122ca1b..430bd193 100644 --- a/developer_docs/README.md +++ b/developer_docs/README.md @@ -19,7 +19,8 @@ the Cromshell development environment can be set up by the following steps: python3 -mvenv venv . venv/bin/activate pip install --upgrade pip - pip install -e . -r dev-requirements.txt + pip install -r dev-requirements.txt + pip install -e . ``` After following the above development environment setup steps, cromshell should diff --git a/pyproject.toml b/pyproject.toml index 2ca285fc..0febd5bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,4 +58,4 @@ ignore_missing_imports = true [tool.mypy."pysam.*"] ignore_missing_imports = true -[tool.mypy."pytest.*"] \ No newline at end of file +[tool.mypy."pytest.*"] From db65a8bf4e04c95b41cd1e98196bbfe2f0491ae0 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 10:57:21 -0500 Subject: [PATCH 07/10] minor formatting updates --- developer_docs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer_docs/README.md b/developer_docs/README.md index 430bd193..33d130e1 100644 --- a/developer_docs/README.md +++ b/developer_docs/README.md @@ -20,7 +20,7 @@ the Cromshell development environment can be set up by the following steps: . venv/bin/activate pip install --upgrade pip pip install -r dev-requirements.txt - pip install -e . + pip install -e . ``` After following the above development environment setup steps, cromshell should From 63d10d379d9faa7b97259eed3adc3d2a653319e6 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 14:51:25 -0500 Subject: [PATCH 08/10] updated python support to =>3.9 because 3.7 is no longer being supported and 3.8 support will end this year --- .github/workflows/integration_tests.yml | 2 +- .github/workflows/unit_tests.yml | 2 +- pyproject.toml | 5 ++--- tox.ini | 9 +-------- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 17afdd3a..660db2ba 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [ '3.7', '3.8', '3.9', '3.10' ] + python: [ '3.9', '3.10', '3.11'] steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 7f92b04f..11d1591c 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [ '3.7', '3.8', '3.9', '3.10' ] + python: [ '3.9', '3.10', '3.11'] # Steps represent a sequence of tasks that will be executed as part of the job diff --git a/pyproject.toml b/pyproject.toml index 0febd5bb..610a528d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,17 +16,16 @@ authors=[ {name = "Beri Shifaw", email = "bshifaw@broadinstitute.org"}, ] license={text = "BSD 3-Clause"} -requires-python=">=3.7" +requires-python=">=3.9" classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", - "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", "Programming Language :: Python :: Implementation :: CPython", ] keywords = [ diff --git a/tox.ini b/tox.ini index 19874980..064c8797 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = lint,py37,py38,py39,py310 +envlist = lint,py39,py310,py311 skip_missing_interpreters = true @@ -69,10 +69,3 @@ commands = isort --profile black tests src flake8 src tests pylint --exit-zero src - -[gh-actions] -python = - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 From dd4feb093686218c4e20dfc9f7b0d05e6de11892 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 16:24:13 -0500 Subject: [PATCH 09/10] moved ignore_missing_imports under pytest in pyproject.toml --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 610a528d..9059f2da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,4 @@ -ignore_missing_imports = true [build-system] requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" @@ -50,7 +49,7 @@ optional-dependencies = {dev = { file = ["dev-requirements.txt"]}, tests = { fil where = ["src"] include = ["cromshell*"] -# former dump_setup.cfg configuration for mypy +# former setup.cfg configuration for mypy [tool.mypy."numpy.*"] ignore_missing_imports = true @@ -58,3 +57,4 @@ ignore_missing_imports = true ignore_missing_imports = true [tool.mypy."pytest.*"] +ignore_missing_imports = true From 29d43f6b77b585acce2261d8134a4010e823c097 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 22 Feb 2024 16:29:54 -0500 Subject: [PATCH 10/10] minor formatting change --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 9059f2da..b958c51a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ keywords = [ dynamic = ["dependencies", "optional-dependencies"] [project.urls] -Homepage = "https://github.com/broadinstitute/cromshell" +"Homepage" = "https://github.com/broadinstitute/cromshell" "Bug Tracker" = "https://github.com/broadinstitute/cromshell/issues" [project.scripts]