Skip to content

Commit

Permalink
setuptools->flit for easy dynamic versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
jpreszler committed Sep 18, 2023
1 parent 28d50b9 commit 628db3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
mkdir -p test-sdist
cd test-sdist
python -m venv venv-sdist
venv-sdist/bin/python -m pip install ../dist/CausalPy*.tar.gz
venv-sdist/bin/python -m pip install ../dist/causalpy*.tar.gz
echo "Checking import and version number (on release)"
venv-sdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
cd ..
Expand All @@ -36,7 +36,7 @@ jobs:
mkdir -p test-bdist
cd test-bdist
python -m venv venv-bdist
venv-bdist/bin/python -m pip install ../dist/CausalPy*.whl
venv-bdist/bin/python -m pip install ../dist/causalpy*.whl
echo "Checking import and version number (on release)"
venv-bdist/bin/python -c "import causalpy; assert causalpy.__version__ == '${{ github.ref_name }}' if '${{ github.ref_type }}' == 'tag' else causalpy.__version__; print(causalpy.__version__)"
cd ..
Expand Down
19 changes: 11 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
[build-system]
# Minimum requirements for the build system to execute.
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.0"]
build-backend = "flit_core.buildapi"
requires = ["flit_core>=3.4,<4"]

# This is configuration specific to the `setuptools` build backend.
# This is configuration specific to the `flit` build backend.
# If you are using a different build backend, you will need to change this.
[tool.setuptools.packages.find]
exclude = ["causalpy.test*", "docs*"]
[tool.flit.sdist]
exclude = ["causalpy/test*", "docs/*", "dist/*"]

[tool.setuptools.package-data]
"causalpy.data" = ["*.csv"]
[tool.flit.external-data]
directory = "causalpy/data"

[tool.flit.module]
name="causalpy"

[project]
name = "CausalPy"
version = "0.1.0"
dynamic = ["version"]
description = "Causal inference for quasi-experiments in Python"
readme = "README.md"
license = { file = "LICENSE" }
Expand Down

0 comments on commit 628db3b

Please sign in to comment.