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

Modern build #73

Merged
merged 3 commits into from
Nov 27, 2024
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: 1 addition & 1 deletion .github/workflows/deploy_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
pip install -r requirements-dev.txt
- name: Build wheel
run: |
python setup.py bdist_wheel
python -m pip build --wheel
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: [3.6, 3.7, 3.8, 3.9]
python: [3.7, 3.8, 3.9, "3.10", 3.11]
steps:
- uses: actions/checkout@v2
- name: Set up python environment
Expand All @@ -24,7 +24,7 @@ jobs:
pip install -r requirements-dev.txt
- name: Run tests
run: |
python setup.py pytest
python -m pytest
- name: Build wheel
run: |
python setup.py bdist_wheel
python -m build --wheel
45 changes: 45 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[build-system]
requires = ["hatchling>=1.0", "hatch-vcs"]
build-backend = "hatchling.build"

[project]
name = "wellpathpy"
dynamic = ["version"]
description = "Light package to load well deviations"
readme = "README.md"
authors = [
{ name = "Robert Leckenby", email = "fracgeol@gmail.com" },
{ name = "Jørgen Kvalsvik", email = "j@lambda.is" },
{ name = "Brendon Hall", email = "brendon.hall@gmail.com" },
]
maintainers = [
]
license = { file = "LICENSE" }
platforms = "any"

dependencies = [
"numpy >=1.10",
]

[project.optional-dependencies]
test = [
"pytest",
"hypothesis",
]

[project.urls]
"Homepage" = "https://github.com/Zabamund/wellpathpy"
"Repository" = "https://github.com/Zabamund/wellpathpy"

[tool.hatch.version]
source = "vcs"

[tool.hatch.metadata]
license = "LGPL-3.0"

[tool.pytest.ini_options]
testpaths = ["tests"]

[tool.setuptools_scm]
version_scheme = "post-release"

1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ numpy
setuptools-scm
hypothesis
wheel
build
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

21 changes: 0 additions & 21 deletions setup.py

This file was deleted.

14 changes: 11 additions & 3 deletions wellpathpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import sys
if sys.version_info >= (3, 8):
from importlib import metadata
else:
import importlib_metadata as metadata

try:
import pkg_resources
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = metadata.version(__name__)
except: # PackageNotFoundError
# Don't hard crash when the the version cannot be looked up from the
# metadata, probably because the tests are running from the source dir and
# the module has not been packaged yet.
pass

__all__ = [
Expand Down