Skip to content

Commit 30882a6

Browse files
committed
Move static project metadata to pyproject.toml
1 parent 7ab6269 commit 30882a6

File tree

6 files changed

+69
-48
lines changed

6 files changed

+69
-48
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
FFLAGS="-fallow-argument-mismatch" pip install --no-use-pep517 pyspharm
3737
# for later building/checking
3838
pip install build twine
39-
pip install cython check-manifest
39+
pip install check-manifest
4040
# below here only needed for mpl/cartopy based tests
4141
pip install pytest-mpl
4242
pip install cartopy

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build/
2+
*.pyc
3+
dist/
4+
*.egg-info/
5+
src/pygrib/_pygrib.c
6+
src/pygrib/*.so
7+
test/out.grib
8+
venv/
9+
.eggs/
10+
.idea/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Install and Test Status](https://github.com/jswhit/pygrib/workflows/Install%20and%20Test/badge.svg)](https://github.com/jswhit/pygrib/actions)
1+
[![Install and Test Status](https://github.com/jswhit/pygrib/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jswhit/pygrib/actions)
22
[![PyPI package](https://badge.fury.io/py/pygrib.svg)](http://python.org/pypi/pygrib)
33
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/pygrib/badges/version.svg)](https://anaconda.org/conda-forge/pygrib)
44
[![DOI](https://zenodo.org/badge/28599617.svg)](https://zenodo.org/badge/latestdoi/28599617)

pyproject.toml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,55 @@
11
[build-system]
2-
# minimum requiremets for build system
3-
requires = ["setuptools", "cython", "numpy", "wheel"]
2+
requires = [
3+
"Cython>=0.29",
4+
"oldest-supported-numpy",
5+
"setuptools>=61",
6+
]
47
build-backend = "setuptools.build_meta"
8+
9+
[project]
10+
name = "pygrib"
11+
description = "Python module for reading/writing GRIB files"
12+
readme = "README.md"
13+
authors = [
14+
{name = "Jeff Whitaker", email = "jeffrey.s.whitaker@noaa.gov"},
15+
]
16+
requires-python = ">=3.7"
17+
license = {text = "MIT"}
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.7",
22+
"Programming Language :: Python :: 3.8",
23+
"Programming Language :: Python :: 3.9",
24+
"Programming Language :: Python :: 3.10",
25+
"Programming Language :: Python :: 3.11",
26+
"Programming Language :: Python :: 3.12",
27+
"Intended Audience :: Science/Research",
28+
"License :: OSI Approved :: MIT License",
29+
"Topic :: Software Development :: Libraries :: Python Modules",
30+
]
31+
dependencies = [
32+
"pyproj",
33+
"numpy",
34+
]
35+
dynamic = ["version"]
36+
37+
[project.urls]
38+
Documentation = "https://jswhit.github.io/pygrib/"
39+
Repository = "https://github.com/jswhit/pygrib"
40+
41+
[tool.check-manifest]
42+
ignore = [
43+
".gitignore",
44+
"src/pygrib/*.c",
45+
]
46+
47+
[tool.pytest.ini_options]
48+
testpaths = ["test"]
49+
doctest_optionflags = ["NORMALIZE_WHITESPACE ELLIPSIS"]
50+
51+
[tool.setuptools]
52+
include-package-data = false
53+
54+
[tool.setuptools.packages.find]
55+
where = ["src"]

setup.cfg

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

setup.py

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import os, sys
21
import glob
2+
import os
33
import setuptools
4+
import sys
45
from Cython.Distutils import build_ext
56

67

@@ -97,11 +98,6 @@ def package_files(directory):
9798
)
9899
]
99100

100-
# Import README.md as PyPi long_description
101-
this_directory = os.path.abspath(os.path.dirname(__file__))
102-
with open(os.path.join(this_directory, "README.md")) as f:
103-
long_description = f.read()
104-
105101
# man pages installed in MAN_DIR/man1
106102
if os.environ.get("MAN_DIR"):
107103
man_dir = os.environ.get("MAN_DIR")
@@ -111,31 +107,11 @@ def package_files(directory):
111107
else:
112108
data_files = None
113109

110+
# See pyproject.toml for project metadata
114111
setuptools.setup(
115-
name="pygrib",
112+
name="pygrib", # need by GitHub dependency graph
116113
version=extract_version("src/pygrib/_pygrib.pyx"),
117-
description="Python module for reading/writing GRIB files",
118-
author="Jeff Whitaker",
119-
author_email="jeffrey.s.whitaker@noaa.gov",
120-
url="https://github.com/jswhit/pygrib",
121-
download_url="http://python.org/pypi/pygrib",
122-
license="License :: OSI Approved :: MIT License",
123-
classifiers=[
124-
"Development Status :: 4 - Beta",
125-
"Programming Language :: Python :: 2.7",
126-
"Programming Language :: Python :: 3",
127-
"Programming Language :: Python :: 3.5",
128-
"Programming Language :: Python :: 3.6",
129-
"Programming Language :: Python :: 3.7",
130-
"Programming Language :: Python :: 3.8",
131-
"Programming Language :: Python :: 3.9",
132-
"Intended Audience :: Science/Research",
133-
"License :: OSI Approved :: MIT License",
134-
"Topic :: Software Development :: Libraries :: Python Modules",
135-
],
136114
cmdclass=cmdclass,
137-
long_description=long_description,
138-
long_description_content_type="text/markdown",
139115
scripts=[
140116
"utils/grib_list",
141117
"utils/grib_repack",
@@ -144,13 +120,5 @@ def package_files(directory):
144120
],
145121
ext_modules=ext_modules,
146122
data_files=data_files,
147-
packages=["pygrib"],
148-
package_dir={'':'src'},
149123
package_data=package_data,
150-
setup_requires=["setuptools", "cython"],
151-
install_requires=[
152-
"pyproj",
153-
"setuptools",
154-
"numpy",
155-
],
156124
)

0 commit comments

Comments
 (0)