Skip to content

Commit 1bcefb3

Browse files
committed
covert setup.py to setup.cfg
Thank you https://pypi.org/project/setuptools-py2cfg/ !
1 parent 46b2576 commit 1bcefb3

File tree

7 files changed

+83
-95
lines changed

7 files changed

+83
-95
lines changed

.github/workflows/ci-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ jobs:
8080
step: [lint-readme, pydocstyle]
8181

8282
env:
83-
py-semver: "3.11"
84-
TOXENV: ${{ format('py311-{0}', matrix.step) }}
83+
py-semver: "3.12"
84+
TOXENV: ${{ format('py312-{0}', matrix.step) }}
8585

8686
steps:
8787
- uses: actions/checkout@v4
@@ -130,7 +130,7 @@ jobs:
130130
- name: Set up Python
131131
uses: actions/setup-python@v5
132132
with:
133-
python-version: 3.11
133+
python-version: 3.12
134134
cache: pip
135135
cache-dependency-path: |
136136
requirements.txt

Makefile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ EXTRAS=
2828
# `[[` conditional expressions.
2929
PYSOURCES=$(filter-out $(MODULE)/parser/cwl_v%,$(shell find $(MODULE) -name "*.py")) \
3030
$(wildcard tests/*.py) create_cwl_from_objects.py load_cwl_by_path.py \
31-
setup.py ${MODULE}/parser/cwl_v1_?_utils.py docs/conf.py
32-
DEVPKGS=diff_cover pylint pep257 pydocstyle flake8 tox tox-pyenv \
31+
${MODULE}/parser/cwl_v1_?_utils.py docs/conf.py
32+
DEVPKGS=build diff_cover pylint pep257 pydocstyle flake8 'tox<4' tox-pyenv \
3333
isort wheel autoflake pyupgrade bandit auto-walrus \
3434
-rlint-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt
3535
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
@@ -52,8 +52,8 @@ cleanup: sort_imports format flake8 diff_pydocstyle_report
5252
install-dep: install-dependencies
5353

5454
install-dependencies:
55+
pip install -U pip setuptools wheel
5556
pip install --upgrade $(DEVPKGS)
56-
pip install -r requirements.txt -r mypy-requirements.txt -r docs/requirements.txt
5757

5858
## install-deb-dep : install many of the dev dependencies via apt-get
5959
install-deb-dep:
@@ -65,13 +65,14 @@ install: FORCE
6565

6666
## dev : install the cwl-utils package in dev mode
6767
dev: install-dep
68+
pip install -U pip setuptools wheel
6869
pip install -e .$(EXTRAS)
6970

7071
## dist : create a module package for distribution
7172
dist: dist/${MODULE}-$(VERSION).tar.gz
7273

7374
dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
74-
python setup.py sdist bdist_wheel
75+
python -m build
7576

7677
## docs : make the docs
7778
docs: FORCE
@@ -80,7 +81,6 @@ docs: FORCE
8081
## clean : clean up all temporary / machine-generated files
8182
clean: FORCE
8283
rm -f ${MODULE}/*.pyc tests/*.pyc
83-
python setup.py clean --all || true
8484
rm -Rf .coverage
8585
rm -f diff-cover.html
8686

@@ -98,7 +98,7 @@ pydocstyle: $(PYSOURCES)
9898
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
9999

100100
pydocstyle_report.txt: $(PYSOURCES)
101-
pydocstyle setup.py $^ > $@ 2>&1 || true
101+
pydocstyle $^ > $@ 2>&1 || true
102102

103103
## diff_pydocstyle_report : check Python docstring style for changed files only
104104
diff_pydocstyle_report: pydocstyle_report.txt
@@ -170,7 +170,7 @@ list-author-emails:
170170
@git log --format='%aN,%aE' | sort -u | grep -v 'root'
171171

172172
mypy3: mypy
173-
mypy: $(filter-out setup.py,${PYSOURCES})
173+
mypy: ${PYSOURCES}
174174
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
175175

176176
shellcheck: FORCE
@@ -186,8 +186,8 @@ release-test: FORCE
186186

187187
release: release-test
188188
. testenv2/bin/activate && \
189-
python testenv2/src/${PACKAGE}/setup.py sdist bdist_wheel
190-
. testenv2/bin/activate && \
189+
pip install build && \
190+
python -m build testenv2/src/${PACKAGE} && \
191191
pip install twine && \
192192
twine upload testenv2/src/${PACKAGE}/dist/* && \
193193
git tag ${VERSION} && git push --tags

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"

release-test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ else
1818
HEAD=$(git rev-parse HEAD)
1919
fi
2020
run_tests="bin/py.test --pyargs ${module}"
21-
pipver=20.3.3 # minimum required version of pip for Python 3.10
22-
setuptoolsver=50.0.0 # required for Python 3.10
21+
pipver=23.1 # minimum required version of pip for Python 3.12
22+
setuptoolsver=67.6.1 # required for Python 3.12
2323
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
2424

2525
rm -Rf testenv? || /bin/true
@@ -63,7 +63,7 @@ rm -f lib/python-wheels/setuptools* \
6363
# The following can fail if you haven't pushed your commits to ${repo}
6464
pip install -e "git+${repo}@${HEAD}#egg=${package}${extras}"
6565
pushd src/${package}
66-
pip install -rtest-requirements.txt
66+
pip install -rtest-requirements.txt build
6767
make dist
6868
make test
6969
cp dist/${package}*tar.gz ../../../testenv3/
@@ -84,7 +84,7 @@ rm -f lib/python-wheels/setuptools* \
8484
&& pip install --force-reinstall -U pip==${pipver} \
8585
&& pip install setuptools==${setuptoolsver} wheel
8686
package_tar=$(find . -name "${package}*tar.gz")
87-
pip install "-r${DIR}/test-requirements.txt"
87+
pip install "-r${DIR}/test-requirements.txt" build
8888
pip install "${package_tar}${extras}"
8989
mkdir out
9090
tar --extract --directory=out -z -f ${package}*.tar.gz

setup.cfg

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,63 @@
11
[aliases]
2-
test=pytest
2+
test = pytest
3+
4+
[metadata]
5+
name = cwl-utils
6+
version = attr: cwl_utils.__meta__.__version__
7+
author = Common workflow language working group
8+
author_email = [email protected]
9+
license = Apache 2.0
10+
url = https://github.com/common-workflow-language/cwl-utils
11+
long_description = file: README.rst
12+
long_description_content_type = text/x-rst
13+
classifiers =
14+
Environment :: Console
15+
Intended Audience :: Science/Research
16+
License :: OSI Approved :: Apache Software License
17+
Operating System :: POSIX
18+
Operating System :: MacOS :: MacOS X
19+
Programming Language :: Python :: 3.8
20+
Programming Language :: Python :: 3.9
21+
Programming Language :: Python :: 3.10
22+
Programming Language :: Python :: 3.11
23+
Programming Language :: Python :: 3.12
24+
Typing :: Typed
325

426
[tool:pytest]
527
testpaths = tests
628

29+
[options]
30+
package_dir =
31+
cwl_utils.parser = cwl_utils/parser
32+
cwl_utils.tests = tests
33+
cwl_utils.testdata = testdata
34+
packages =
35+
cwl_utils
36+
cwl_utils.parser
37+
cwl_utils.tests
38+
cwl_utils.testdata
39+
install_requires = file: requirements.txt
40+
include_package_data = True
41+
python_requires = >=3.8
42+
test_suite = tests
43+
tests_require =
44+
pytest<8
45+
pytest-mock
46+
47+
[options.entry_points]
48+
console_scripts =
49+
cwl-cite-extract=cwl_utils.cite_extract:main
50+
cwl-docker-extract=cwl_utils.docker_extract:main
51+
cwl-expression-refactor=cwl_utils.expression_refactor:main
52+
cwl-graph-split=cwl_utils.graph_split:main
53+
cwl-normalizer=cwl_utils.normalizer:main
54+
755
[tool:isort]
856
multi_line_output = 3
957
include_trailing_comma = True
1058
force_grid_wrap = 0
1159
use_parentheses = True
1260
line_length = 88
61+
62+
[options.extras_require]
63+
pretty = cwlformat

setup.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

tox.ini

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ envlist =
44
py3{8,9,10,11,12}-unit,
55
py3{8,9,10,11,12}-bandit,
66
py3{8,9,10,11,12}-mypy,
7-
py311-lint-readme,
8-
py311-pydocstyle
9-
7+
py312-lint-readme,
8+
py312-pydocstyle
9+
isolated_build = True
1010
skip_missing_interpreters = True
1111

1212
[pytest]
@@ -26,8 +26,8 @@ description =
2626
py3{8,9,10,11,12}-lint: Lint the Python code
2727
py3{8,9,10,11,12}-bandit: Search for common security issues
2828
py3{8,9,10,11,12}-mypy: Check for type safety
29-
py311-pydocstyle: docstring style checker
30-
py311-lint-readme: Lint the README.rst->.md conversion
29+
py312-pydocstyle: docstring style checker
30+
py312-lint-readme: Lint the README.rst->.md conversion
3131

3232
passenv =
3333
CI
@@ -56,28 +56,27 @@ allowlist_externals =
5656
py3{8,9,10,11,12}-{mypy,shellcheck,lint,unit}: make
5757

5858
skip_install =
59-
py{8,9,10,11,12}-lint: true
60-
py{8,9,10,11,12}-bandit: true
59+
py3{8,9,10,11,12}-lint: true
60+
py3{8,9,10,11,12}-bandit: true
6161

6262
extras =
6363
py3{8,9,10,11,12}-unit: pretty
6464

65-
[testenv:py311-pydocstyle]
65+
[testenv:py312-pydocstyle]
6666
allowlist_externals = make
6767
commands = make diff_pydocstyle_report
6868
deps =
6969
pydocstyle
7070
diff-cover
7171
skip_install = true
7272

73-
[testenv:py311-lint-readme]
73+
[testenv:py312-lint-readme]
7474
description = Lint the README.rst->.md conversion
7575
commands =
76-
python setup.py sdist
77-
python setup.py bdist_wheel
78-
twine check dist/*
76+
make clean dist
77+
twine check dist/cwl[-_]utils*
7978
deps =
8079
twine
81-
wheel
80+
build
8281
readme_renderer[rst]
8382
skip_install = true

0 commit comments

Comments
 (0)