diff --git a/.github/workflows/deploy_to_pypi.yml b/.github/workflows/deploy_to_pypi.yml index 46453f2..6ecc78b 100644 --- a/.github/workflows/deploy_to_pypi.yml +++ b/.github/workflows/deploy_to_pypi.yml @@ -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: diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index 1ac0432..8da872b 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -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 \ No newline at end of file + python -m build --wheel diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0a93ea2 --- /dev/null +++ b/pyproject.toml @@ -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" + diff --git a/requirements-dev.txt b/requirements-dev.txt index 7cfed63..23256a0 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,3 +3,4 @@ numpy setuptools-scm hypothesis wheel +build diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 9af7e6f..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[aliases] -test=pytest \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 9d04e2f..0000000 --- a/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python3 - -from setuptools import setup - -with open("README.md", "r") as f: - long_description = f.read() - -setup(name='wellpathpy', - description='Light package to load well deviations', - long_description=long_description, - author='Robert Leckenby, Brendon Hall, Jørgen Kvalsvik', - author_email='fracgeol@gmail.com', - url='https://github.com/Zabamund/wellpathpy', - packages=['wellpathpy'], - license='LGPL-3.0', - platforms='any', - install_requires=['numpy >=1.10'], - setup_requires=['setuptools >=28', 'setuptools_scm', 'pytest-runner'], - tests_require=['pytest', 'hypothesis'], - use_scm_version=True, - )