-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: automated versioning with setuptools_scm and improved workflows (
#182) * ci: upgrade deploy and test ci * build: use `setuptools_scm` for dynamic versioning * build: update package versioning * build: use post-release versioning * docs: update email * fix: update java, use `uv` and point to tests dir * build: allow future pandas `stack` * docs: show docs also for older versions * chore: remove `requirements.yaml` * fix: clean up * test: skip url_retrieve test in gh runner * chore: set gh env
- Loading branch information
Showing
13 changed files
with
223 additions
and
173 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ '*' ] | ||
schedule: | ||
- cron: "0 5 * * TUE" | ||
|
||
# Cancel any in-progress runs when a new run is triggered | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
# Build the Python SDist and wheel, performs metadata and readme linting | ||
name: Build and verify package | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Needed for setuptools_scm | ||
- uses: hynek/build-and-inspect-python-package@v2 | ||
id: baipp | ||
|
||
outputs: | ||
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }} | ||
|
||
test: | ||
# Test package build in matrix of OS and Python versions | ||
name: Test package | ||
needs: [build] | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ${{ fromJSON(needs.build.outputs.python-versions) }} | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Needed for setuptools_scm | ||
|
||
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 22 | ||
|
||
- name: Download package | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Install package and dependencies | ||
run: | | ||
python -m pip install uv | ||
uv pip install --system "$(ls dist/*.whl)[dev]" | ||
- name: Test with pytest | ||
run: | | ||
pytest | ||
env: | ||
GITHUB_ACTIONS: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,76 @@ | ||
# Formater and linter settings | ||
[build-system] | ||
requires = ["setuptools>=64", "setuptools_scm>=8"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name="powerplantmatching" | ||
dynamic = ["version"] | ||
description="Toolset for generating and managing Power Plant Data" | ||
readme="README.md" | ||
authors = [{ name = "Fabian Hofmann (FIAS)", email = "[email protected]" }, | ||
{ name = "Jonas Hoersch (KIT)" }, | ||
{ name = "Fabian Gotzens (FZ Jülich)" }] | ||
license = { file = "LICENSE" } | ||
classifiers=[ | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Environment :: Console", | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
] | ||
|
||
requires-python = ">=3.9" | ||
|
||
dependencies = [ | ||
"numpy", | ||
"scipy", | ||
"pandas>=0.24.0", | ||
"networkx>=1.10", | ||
"pycountry", | ||
"country_converter", | ||
"xlrd", | ||
"seaborn", | ||
"pyyaml >=5.1.0", | ||
"requests", | ||
"matplotlib", | ||
"geopy", | ||
"xlrd", | ||
"unidecode", | ||
"entsoe-py >=0.3.1", | ||
"deprecation", | ||
"tqdm", | ||
"openpyxl", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/PyPSA/powerplantmatching" | ||
Source = "https://github.com/PyPSA/powerplantmatching" | ||
|
||
[project.optional-dependencies] | ||
docs= [ | ||
"numpydoc", | ||
"sphinx", | ||
"sphinx-book-theme", | ||
"nbsphinx", | ||
"sphinx-automodapi", | ||
] | ||
dev= ["pre-commit", "pytest", "pytest-cov"] | ||
|
||
# setuptools_scm settings | ||
|
||
[tool.setuptools_scm] | ||
version_scheme = "post-release" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["powerplantmatching"] | ||
|
||
# Formatter and linter settings | ||
|
||
[tool.ruff] | ||
line-length = 88 | ||
extend-include = ['*.ipynb'] | ||
|
||
[tool.ruff.lint] | ||
|
@@ -21,4 +90,4 @@ select = [ | |
[tool.pytest.ini_options] | ||
filterwarnings = [ | ||
"error::FutureWarning", # Raise all FutureWarnings as errors | ||
] | ||
] |
Oops, something went wrong.