Skip to content

Commit

Permalink
Update pyproject and add CI test to pip installation (#57)
Browse files Browse the repository at this point in the history
* Update pyproject

* Add last line pyproject

* Add pip and package test in release.yml

* Revise install and test in release.yml

* Add checkout and python installation
  • Loading branch information
davide-f authored Dec 22, 2024
1 parent bb4e6c0 commit d65faa6
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,37 @@ jobs:
with:
name: python-package-distributions
path: dist/

install_and_test:
name: Install and test build distribution
needs:
- build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Install package and dependencies
run: |
python -m pip install uv
uv pip install --compile --system "$(ls dist/*.whl)[dev]"
- name: Test package
run: |
earth_osm extract power --regions benin --features substation line
release:
name: Create Release
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
- install_and_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -66,4 +91,3 @@ jobs:
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

8 changes: 5 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["pip", "setuptools>=64", "setuptools-scm>=8", "wheel", "twine"]
requires = ["pip", "setuptools>=64", "setuptools_scm>=8", "wheel", "twine"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -99,8 +99,10 @@ no_implicit_optional = true
warn_unused_ignores = true
show_error_code_links = true


[[tool.mypy.overrides]]
module = "earth_osm.*"
disallow_untyped_defs = true
check_untyped_defs = true
check_untyped_defs = true

[tool.setuptools.dynamic]
version = {attr = "earth_osm.__version__"}

0 comments on commit d65faa6

Please sign in to comment.