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

Add pyproject.toml file for static metadata #167

Merged
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
5 changes: 1 addition & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@ jobs:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-docs.txt
sudo apt update -y && sudo apt install -y latexmk texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended dvipng
- name: Install DeltaMetrics
run: |
pip install setuptools
pip install --no-build-isolation .
pip install .
- name: Build and test documentation
run: |
(cd docs && make docs)
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

11 changes: 2 additions & 9 deletions deltametrics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
from . import cube
from . import plan
from . import mask
from . import mobility
from . import section
from . import strat
from . import utils
from . import sample_data
from ._version import __version__
import deltametrics.sample_data as sample_data
from deltametrics._version import __version__
20 changes: 6 additions & 14 deletions deltametrics/sample_data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
from .sample_data import (
_get_golf_path,
_get_xslope_path,
_get_aeolian_path,
_get_rcm8_path,
_get_landsat_path,
golf,
xslope,
aeolian,
rcm8,
landsat,
savi2020
)
from . import cube
from deltametrics.sample_data.sample_data import aeolian
from deltametrics.sample_data.sample_data import golf
from deltametrics.sample_data.sample_data import landsat
from deltametrics.sample_data.sample_data import rcm8
from deltametrics.sample_data.sample_data import savi2020
from deltametrics.sample_data.sample_data import xslope
10 changes: 8 additions & 2 deletions deltametrics/sample_data/sample_data.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import sys
import os
import pkg_resources
import warnings

import numpy as np
import netCDF4
import pooch

if sys.version_info >= (3, 12): # pragma: no cover (PY12+)
import importlib.resources as importlib_resources
else: # pragma: no cover (<PY312)
import importlib_resources

from deltametrics._version import __version__
from deltametrics.cube import DataCube


# enusre DeprecationWarning is shown
warnings.simplefilter("default")

Expand All @@ -20,7 +25,8 @@
base_url='https://github.com/DeltaRCM/DeltaMetrics/raw/develop/deltametrics/sample_data/files/',
env="DELTAMETRICS_DATA_DIR",
)
with pkg_resources.resource_stream("deltametrics.sample_data", "registry.txt") as registry_file:
path_to_registry = importlib_resources.files("deltametrics.sample_data").joinpath("registry.txt")
with open(path_to_registry, "rb") as registry_file:
REGISTRY.load_registry(registry_file)


Expand Down
113 changes: 113 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
[project]
name = "DeltaMetrics"
requires-python = ">=3.8"
description = "Tools for manipulating sedimentologic data cubes."
keywords = [
]
authors = [
{ name = "Andrew Moodie", email = "[email protected]" },
]
maintainers = [
{ name = "Andrew Moodie", email = "[email protected]" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Hydrology",
"Topic :: Scientific/Engineering :: Physics",
]
dependencies = [
"h5py",
"h5netcdf",
"importlib-resources; python_version < '3.12'",
"matplotlib",
"netCDF4",
"numba",
"numpy",
"pooch",
"pyyaml",
"scikit-image",
"scipy",
"xarray",
]
dynamic = [
"version",
"readme",
]

[project.license]
text = "MIT"

[project.urls]
documentation = "https://deltarcm.github.io/deltametrics"
homepage = "https://github.com/DeltaRCM/DeltaMetrics"
repository = "https://github.com/DeltaRCM/DeltaMetrics"

[build-system]
requires = [
"setuptools >=61",
]
build-backend = "setuptools.build_meta"

[tool.setuptools.dynamic.readme]
file = "README.rst"
content-type = "text/x-rst"

[tool.setuptools.dynamic.version]
attr = "deltametrics._version.__version__"

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
deltametrics = [
"sample_data/registry.txt",
]

[project.optional-dependencies]
docs = [
"pyvista",
"sphinx",
]
testing = [
"coveralls",
"pytest",
"pytest-cov",
]

[tool.setuptools.packages.find]
where = [
".",
]
include = [
"deltametrics*",
]

[tool.coverage.run]
relative_files = true

[tool.pytest.ini_options]
minversion = "6.0"
testpaths = [
"tests",
]
norecursedirs = [
".*",
"*.egg*",
"build",
"dist",
]
addopts = [
"--ignore=setup.py",
"--tb=native",
"--durations=16",
"--strict-markers",
"-vvv",
]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
importlib-resources; python_version < '3.12'
matplotlib>3.6.0
numpy>=1.20
scipy>=1.5
Expand Down
30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

Loading