Skip to content

Commit f67fa90

Browse files
authored
Merge pull request #205 from NREL/pp/pyproject_toml
Move to pyproject.toml
2 parents 194c212 + b1712bf commit f67fa90

File tree

7 files changed

+178
-120
lines changed

7 files changed

+178
-120
lines changed

.github/workflows/publish_to_pypi.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ jobs:
1212
# IMPORTANT: this permission is mandatory for trusted publishing
1313
id-token: write
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Set up Python
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
19-
python-version: 3.9
19+
python-version: 3.11
2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install setuptools wheel
23+
pip install .[build]
2424
- name: Build a binary wheel
2525
run:
26-
python setup.py sdist bdist_wheel
26+
python -m build --sdist --wheel --outdir dist/ .
27+
- name: Check distribution files
28+
run: |
29+
twine check dist/*
2730
- name: Publish distribution to PyPI
2831
uses: pypa/gh-action-pypi-publish@release/v1

MANIFEST.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
exclude tests/**
2+
exclude examples/**
3+
exclude docs/**
4+
exclude build/**
5+
exclude dist/**
6+
exclude .github/**
7+
exclude .git/**
8+
exclude conda.recipe/**
9+
exclude .*
10+
exclude *.git
11+
exclude Dockerfile
12+
exclude docker-compose.yml

conda.recipe/meta.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,34 @@ requirements:
1616
- pip
1717
- setuptools
1818
- click
19+
- fsspec
20+
- dask
1921
- h5py>=2.10.0,!=3.0.0
2022
- numpy>=1.16
2123
- pandas
2224
- psutil
2325
- scipy
26+
- s3fs
27+
- scikit-learn
2428
- toml
2529
- PyYAML
30+
- xarray
2631
run:
2732
- python
2833
- pip
2934
- click
35+
- fsspec
36+
- dask
3037
- h5py>=2.10.0,!=3.0.0
3138
- {{ pin_compatible('numpy') }}
3239
- pandas
3340
- psutil
3441
- scipy
42+
- s3fs
43+
- scikit-learn
3544
- toml
3645
- PyYAML
46+
- xarray
3747
run-constrained:
3848
- h5pyd
3949

pyproject.toml

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 61",
4+
"setuptools_scm[toml] >= 8",
5+
]
6+
build-backend = 'setuptools.build_meta'
7+
8+
[project]
9+
name="NREL-rex"
10+
dynamic = ["version"]
11+
description = "National Renewable Energy Laboratory's (NREL's) REsource eXtraction tool: rex"
12+
readme = {file = "README.rst", content-type = "text/x-rst"}
13+
authors = [
14+
{name = "Michael Rossol", email = "[email protected]"},
15+
]
16+
maintainers = [
17+
{name = "Grant Buster", email = "[email protected]"},
18+
{name = "Paul Pinchuk", email = "[email protected]"},
19+
{name = "Brandon Benton", email = "[email protected]"},
20+
]
21+
license = "BSD-3-Clause"
22+
keywords = ["rex", "NREL"]
23+
requires-python = ">= 3.9"
24+
classifiers=[
25+
"Development Status :: 4 - Beta",
26+
"Intended Audience :: Science/Research",
27+
"Natural Language :: English",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Programming Language :: Python :: 3.11",
31+
]
32+
dependencies = [
33+
"click>=8.1.8,<9",
34+
"fsspec>=2021.09.0,<2025",
35+
"dask>=2024.8.0,<2025",
36+
"h5py>=2.10.0,!=3.0.0",
37+
"h5pyd>=0.18.0,<1",
38+
"numpy>=1.16",
39+
"pandas>=2.0.0,<3",
40+
"packaging>=24.2,<25",
41+
"psutil>=7.0.0,<8",
42+
"PyYAML>=6.0.2,<7",
43+
"s3fs>=2023.6.0,<2024",
44+
"scikit-learn>=1.6.1,<2",
45+
"scipy>=1.3,<2",
46+
"toml>=0.10.2,<0.11",
47+
"xarray>=2024.07.0,<2026",
48+
]
49+
50+
[project.optional-dependencies]
51+
test = [
52+
"pytest>=8.3.3,<9",
53+
"pytest-timeout>=2.3.1,<3",
54+
"flaky>=3.8.1,<4",
55+
]
56+
dev = [
57+
"flake8",
58+
"pre-commit",
59+
"pylint",
60+
]
61+
hsds = [
62+
"hsds>=0.8.4,<1",
63+
]
64+
build = [
65+
"build>=0.10,<1",
66+
"pkginfo>=1.10.0,<2",
67+
"twine>=6.1.0,<7",
68+
]
69+
70+
[project.urls]
71+
homepage = "https://www2.nrel.gov/gis/renewable-energy-potential"
72+
documentation = "https://nrel.github.io/rex/"
73+
repository = "https://github.com/NREL/rex"
74+
75+
[project.scripts]
76+
rex = "rex.resource_extraction.resource_cli:main"
77+
NSRDBX = "rex.resource_extraction.nsrdb_cli:main"
78+
WINDX = "rex.resource_extraction.wind_cli:main"
79+
WaveX = "rex.resource_extraction.wave_cli:main"
80+
MultiYearX = "rex.resource_extraction.multi_year_resource_cli:main"
81+
US-wave = "rex.resource_extraction.US_wave_cli:main"
82+
rechunk = "rex.rechunk_h5.rechunk_cli:main"
83+
combine-h5 = "rex.rechunk_h5.combine_h5_cli:main"
84+
temporal-stats = "rex.temporal_stats.temporal_stats_cli:main"
85+
wind-rose = "rex.joint_pd.wind_rose_cli:main"
86+
87+
[project.entry-points."xarray.backends"]
88+
rex = "rex.external.rexarray:RexBackendEntrypoint"
89+
90+
91+
[tool.setuptools]
92+
packages = ["rex"]
93+
94+
[tool.setuptools.dynamic]
95+
version = {attr = "rex.version.__version__"}
96+
97+
98+
[tool.coverage.run]
99+
branch = true
100+
101+
[tool.coverage.report]
102+
# Regexes for lines to exclude from consideration
103+
exclude_also = [
104+
# Have to re-enable the standard pragma
105+
"pragma: no cover",
106+
107+
# Don't complain about missing debug-only code:
108+
"if self\\.debug",
109+
110+
# Don't complain about repr methods
111+
"def __repr__",
112+
"def _repr_markdown_",
113+
114+
# Don't complain about data I/O code
115+
"def load*",
116+
"def _load*",
117+
118+
# Don't complain if tests don't hit defensive assertion code:
119+
"raise AssertionError",
120+
"raise NotImplementedError",
121+
122+
# Don't complain if non-runnable code isn't run:
123+
"if __name__ == .__main__.:",
124+
125+
# Don't complain about abstract methods, they aren't run:
126+
"@(abc\\.)?abstractmethod",
127+
128+
# Don't complain about logging debugging functions
129+
"def print_logging_info*",
130+
"def __cls_name",
131+
]
132+
133+
omit = [
134+
# omit test files
135+
"tests/*",
136+
# omit init files
137+
"__init__.py",
138+
# omit version file
139+
"version.py",
140+
# omit pixi files
141+
".pixi/*",
142+
]
143+
144+
145+
[tool.pytest.ini_options]
146+
addopts = "--disable-warnings"
147+
testpaths = ["tests"]

requirements.txt

Lines changed: 0 additions & 15 deletions
This file was deleted.

rex/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""rex Version number"""
22

3-
__version__ = "0.2.99"
3+
__version__ = "0.2.100"

setup.py

Lines changed: 0 additions & 99 deletions
This file was deleted.

0 commit comments

Comments
 (0)