Skip to content

Commit 7ef6bb7

Browse files
mr-cGlassOfWhiskey
andcommitted
switch to hatch from setuptools
Co-authored-by: GlassOfWhiskey <[email protected]>
1 parent c39b6e6 commit 7ef6bb7

File tree

181 files changed

+128
-138
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+128
-138
lines changed

.github/workflows/ci-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
python-version: ${{ env.py-semver }}
4646
cache: pip
4747
cache-dependency-path: |
48-
requirements.txt
4948
tox.ini
5049
5150
- name: install dev libraries
@@ -136,9 +135,6 @@ jobs:
136135
with:
137136
python-version: 3.12
138137
cache: pip
139-
cache-dependency-path: |
140-
requirements.txt
141-
test-requirements.txt
142138

143139
- name: Install packages
144140
run: |

.github/workflows/tag_to_publish.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ jobs:
2727
uses: actions/setup-python@v6
2828
with:
2929
python-version: 3.12
30-
31-
- name: Cache for pip
32-
uses: actions/cache@v5
33-
with:
34-
path: ~/.cache/pip
35-
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
30+
cache: pip
3631

3732
- name: Install packages
3833
run: |

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ instance/
6565

6666
# Sphinx documentation
6767
docs/_build/
68+
docs/autoapi/
6869

6970
# PyBuilder
7071
target/
@@ -110,3 +111,9 @@ testenv*/
110111
# PyCharm
111112
.idea/
112113

114+
# Backup files
115+
*.orig
116+
*~
117+
118+
# Temporary files
119+
*.swp

MANIFEST.in

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

Makefile

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222

2323
MODULE=cwl_utils
2424
PACKAGE=cwl-utils
25-
EXTRAS=
25+
EXTRAS="[testing]"
2626

2727
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2828
# `[[` conditional expressions.
2929
PYSOURCES=$(filter-out $(MODULE)/parser/cwl_v%,$(shell find $(MODULE) -name "*.py")) \
30-
$(wildcard tests/*.py) create_cwl_from_objects.py load_cwl_by_path.py \
30+
create_cwl_from_objects.py load_cwl_by_path.py \
3131
${MODULE}/parser/cwl_v1_?_utils.py docs/conf.py
32-
DEVPKGS=build diff_cover pylint pep257 ruff 'tox<4' tox-pyenv \
32+
DEVPKGS=build diff_cover pylint pep257 ruff 'tox>=4' \
3333
wheel autoflake pyupgrade bandit auto-walrus \
34-
-rlint-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt
34+
-rlint-requirements.txt -rmypy-requirements.txt
3535
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage ruff sloccount \
3636
python-flake8 python-mock shellcheck
3737
VERSION=v$(shell echo $$(tail -n 1 cwl_utils/__meta__.py | awk '{print $$3}'))
@@ -52,7 +52,7 @@ cleanup: sort_imports format flake8 pydocstyle
5252
install-dep: install-dependencies
5353

5454
install-dependencies:
55-
pip install -U pip setuptools wheel
55+
pip install -U pip wheel build
5656
pip install --upgrade $(DEVPKGS)
5757

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

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

7171
## dist : create a module package for distribution
7272
dist: dist/${MODULE}-$(VERSION).tar.gz
7373

7474
dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
75-
python -m build
75+
python3 -m build
7676

7777
## docs : make the docs
7878
docs: FORCE
7979
cd docs && $(MAKE) html
8080

8181
## clean : clean up all temporary / machine-generated files
8282
clean: FORCE
83-
rm -f ${MODULE}/*.pyc tests/*.pyc
83+
rm -f ${MODULE}/*.pyc ${MODULE}/tests/*.pyc
8484
rm -Rf .coverage
8585
rm -f diff-cover.html
8686

8787
# Linting and code style related targets
8888
## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
89-
sort_imports: $(PYSOURCES)
90-
isort $^
89+
sort_imports: FORCE
90+
isort $(PYSOURCES)
9191

92-
remove_unused_imports: $(PYSOURCES)
93-
autoflake --in-place --remove-all-unused-imports $^
92+
remove_unused_imports: FORCE
93+
autoflake --in-place --remove-all-unused-imports $(PYSOURCES)
9494

9595
pep257: pydocstyle
9696
## pydocstyle : check Python docstring style
97-
pydocstyle: $(PYSOURCES)
98-
ruff check $^
97+
pydocstyle: FORCE
98+
ruff check $(PYSOURCES)
9999

100100
## codespell : check for common misspellings
101-
codespell:
101+
codespell: FORCE
102102
codespell -w $(shell git ls-files | grep -v mypy-stubs)
103103

104104
## format : check/fix all code indentation and formatting (runs black)
105-
format: $(PYSOURCES) FORCE
105+
format: FORCE
106106
black $(PYSOURCES)
107107

108-
format-check: $(PYSOURCES)
109-
black --diff --check $^
108+
format-check: FORCE
109+
black --diff --check $(PYSOURCES)
110110

111111
## pylint : run static code analysis on Python code
112-
pylint: $(PYSOURCES)
112+
pylint: FORCE
113113
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
114-
$^ -j0|| true
114+
$(PYSOURCES) -j0|| true
115115

116-
pylint_report.txt: $(PYSOURCES)
116+
pylint_report.txt: FORCE
117117
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
118-
$^ -j0> $@ || true
118+
$(PYSOURCES) -j0> $@ || true
119119

120120
diff_pylint_report: pylint_report.txt
121121
diff-quality --compare-branch=main --violations=pylint pylint_report.txt
@@ -144,34 +144,37 @@ diff-cover.html: coverage.xml
144144
diff-cover --compare-branch=main $^ --html-report $@
145145

146146
## test : run the cwl-utils test suite
147-
test: $(PYSOURCES)
148-
python -m pytest ${PYTEST_EXTRA}
147+
test: FORCE
148+
python3 -m pytest ${PYTEST_EXTRA}
149149

150150
## testcov : run the cwl-utils test suite and collect coverage
151-
testcov: $(PYSOURCES)
152-
python -m pytest --cov ${PYTEST_EXTRA}
151+
testcov: FORCE
152+
python3 -m pytest --cov ${PYTEST_EXTRA}
153153

154-
sloccount.sc: $(PYSOURCES) Makefile
155-
sloccount --duplicates --wide --details $^ > $@
154+
sloccount.sc: FORCE
155+
sloccount --duplicates --wide --details $(PYSOURCES) Makefile > $@
156156

157157
## sloccount : count lines of code
158-
sloccount: $(PYSOURCES) Makefile
159-
sloccount $^
158+
sloccount: FORCE
159+
sloccount $(PYSOURCES) Makefile
160160

161161
list-author-emails:
162162
@echo 'name, E-Mail Address'
163163
@git log --format='%aN,%aE' | sort -u | grep -v 'root'
164164

165-
mypy3: mypy
166-
mypy: ${PYSOURCES}
167-
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
165+
mypy: FORCE
166+
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $(PYSOURCES)
167+
168+
mypyc: FORCE
169+
MYPYPATH=mypy-stubs HATCH_BUILD_HOOKS_ENABLE=1 pip install --verbose -e . \
170+
&& pytest "${PYTEST_EXTRA}"
168171

169172
shellcheck: FORCE
170173
shellcheck release-test.sh
171174

172-
pyupgrade: $(PYSOURCES)
173-
pyupgrade --exit-zero-even-if-changed --py310-plus $^
174-
auto-walrus $^
175+
pyupgrade: FORCE
176+
pyupgrade --exit-zero-even-if-changed --py310-plus $(PYSOURCES)
177+
auto-walrus $(PYSOURCES)
175178

176179
release-test: FORCE
177180
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
@@ -180,13 +183,13 @@ release-test: FORCE
180183
release: release-test
181184
. testenv2/bin/activate && \
182185
pip install build && \
183-
python -m build testenv2/src/${PACKAGE} && \
186+
python3 -m build testenv2/src/${PACKAGE} && \
184187
pip install twine && \
185188
twine upload testenv2/src/${PACKAGE}/dist/* && \
186189
git tag ${VERSION} && git push --tags
187190

188-
flake8: $(PYSOURCES)
189-
flake8 $^
191+
flake8: FORCE
192+
flake8 $(PYSOURCES)
190193

191194
cwl_utils/parser/cwl_v1_0.py: FORCE
192195
schema-salad-tool --codegen python \

cwl_utils/hello.simg

4.03 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)