Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to setuptools_scm #186

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
*.egg-info
build
dist

cwltest/_version.py
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
include Makefile gittaggers.py test-requirements.txt mypy-requirements.txt requirements.txt tox.ini mypy.ini
include Makefile test-requirements.txt mypy-requirements.txt requirements.txt tox.ini mypy.ini
include dev-requirements.txt .flake8 .coveragerc release-test.sh
include docs/Makefile docs/conf.py docs/requirements.txt docs/_static/favicon.ico docs/*.rst
include cwltest/*.yml
Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
DEVPKGS=-rdev-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
python-flake8 python-mock shellcheck
VERSION=2.3.$(shell TZ=UTC git log --first-parent --max-count=1 \
VERSION=2.4.$(shell TZ=UTC git log --first-parent --max-count=1 \
--format=format:%cd --date=format-local:%Y%m%d%H%M%S)

## all : default task (install in dev mode)
Expand Down Expand Up @@ -105,10 +105,10 @@ codespell:

## format : check/fix all code indentation and formatting (runs black)
format: $(PYSOURCES) mypy-stubs
black $^
black --exclude cwltest/_version.py $^

format-check: $(PYSOURCES) mypy-stubs
black --diff --check $^
black --diff --check --exclude cwltest/_version.py $^

## pylint : run static code analysis on Python code
pylint: $(PYSOURCES)
Expand Down Expand Up @@ -151,7 +151,7 @@ test: $(PYSOURCES)

## testcov : run the cwltest test suite and collect coverage
testcov: $(PYSOURCES)
python setup.py test --addopts "--cov" ${PYTEST_EXTRA}
pytest --cov ${PYTEST_EXTRA}

sloccount.sc: $(PYSOURCES) Makefile
sloccount --duplicates --wide --details $^ > $@
Expand All @@ -165,7 +165,7 @@ list-author-emails:
@git log --format='%aN,%aE' | sort -u | grep -v 'root'

mypy3: mypy
mypy: $(filter-out setup.py gittagger.py,$(PYSOURCES))
mypy: $(filter-out setup.py,$(PYSOURCES))
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^

pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
Expand All @@ -176,16 +176,18 @@ release-test: FORCE
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
./release-test.sh

release: release-test
release:
export SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} && \
./release-test.sh && \
. testenv2/bin/activate && \
pip install build && \
python -m build testenv2/src/${PACKAGE} && \
pip install twine && \
twine upload testenv2/src/${PACKAGE}/dist/* && \
git tag ${VERSION} && git push --tags

flake8: $(PYSOURCES)
flake8 $^
flake8: FORCE
flake8 $(PYSOURCES)

FORCE:

Expand Down
37 changes: 0 additions & 37 deletions gittaggers.py

This file was deleted.

18 changes: 5 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,18 @@
import os
import pathlib
import sys
from typing import List

import setuptools.command.egg_info as egg_info_cmd
from setuptools import setup

SETUP_DIR = os.path.dirname(__file__)
README = os.path.join(SETUP_DIR, "README.rst")

try:
import gittaggers

tagger = gittaggers.EggInfoFromGit
except ImportError:
tagger = egg_info_cmd.egg_info

needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
pytest_runner = ["pytest < 8", "pytest-runner"] if needs_pytest else []
pytest_runner: List[str] = ["pytest < 8", "pytest-runner"] if needs_pytest else []

setup(
name="cwltest",
version="2.3", # update the VERSION prefix in the Makefile as well 🙂
description="Common Workflow Language testing framework",
long_description=open(README).read(),
long_description_content_type="text/x-rst",
Expand All @@ -30,8 +22,9 @@
url="https://github.com/common-workflow-language/cwltest",
download_url="https://github.com/common-workflow-language/cwltest",
license="Apache 2.0",
python_requires=">=3.8, <4",
setup_requires=[] + pytest_runner,
python_requires=">=3.8,<3.13",
use_scm_version=True,
setup_requires=pytest_runner + ["setuptools_scm>=8.0.4,<9"],
packages=["cwltest", "cwltest.tests"],
package_dir={"cwltest.tests": "tests"},
package_data={"cwltest": ["py.typed"], "tests": ["test-data/*"]},
Expand All @@ -57,7 +50,6 @@
],
},
zip_safe=True,
cmdclass={"egg_info": tagger},
classifiers=[
"Environment :: Console",
"License :: OSI Approved :: Apache Software License",
Expand Down
Loading