Skip to content

Commit

Permalink
Replacing Setup.py with Pyproject.py (#279)
Browse files Browse the repository at this point in the history
* replaced setup.cfg and setup.py completely with pyproject.toml, removed recursive packaging from test-requirements.txt and dev-requirements.txt, removed setup* from tox.ini,

* updated mypy and issort version

* In git actions removed setup.py check command, currently no integrated solution to validate pyproject.toml

* updated python support to =>3.9 because 3.7 is no longer being supported and 3.8 support will end this year

---------

Co-authored-by: bshifaw <[email protected]>
  • Loading branch information
bshifaw and bshifaw authored Feb 23, 2024
1 parent d6727df commit 4a485d4
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 89 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/pypi_packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
isort==4.3.21
isort==5.13.2
tox
wheel
bumpversion
twine
black
flake8
pylint
tomli==2.0.1
cython
sphinx
sphinx-rtd-theme
mypy==0.770
-r requirements.txt
mypy==1.8.0
6 changes: 3 additions & 3 deletions developer_docs/runtests.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 47 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
Expand All @@ -7,8 +8,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 = "[email protected]"},
{name = "Louis Bergelson", email = "[email protected]"},
{name = "Beri Shifaw", email = "[email protected]"},
]
license={text = "BSD 3-Clause"}
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.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"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"
"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 = ["cromshell*"]

# former setup.cfg configuration for mypy
[tool.mypy."numpy.*"]
ignore_missing_imports = true

[tool.mypy."pysam.*"]
ignore_missing_imports = true

[tool.mypy."pytest.*"]
ignore_missing_imports = true
8 changes: 0 additions & 8 deletions setup.cfg

This file was deleted.

54 changes: 0 additions & 54 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pytest
pytest-cov
pytest-dependency
coverage>=4.5
-r requirements.txt
25 changes: 11 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 \
Expand All @@ -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}

Expand All @@ -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]
Expand All @@ -61,14 +65,7 @@ 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]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310

0 comments on commit 4a485d4

Please sign in to comment.