summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rwxr-xr-xpint/pint_convert.py (renamed from pint/pint-convert)7
-rw-r--r--pyproject.toml68
-rw-r--r--setup.cfg61
-rw-r--r--setup.py5
5 files changed, 75 insertions, 68 deletions
diff --git a/CHANGES b/CHANGES
index 19a41d9..acd74b4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,8 @@ Pint Changelog
0.21 (unreleased)
-----------------
+- Add PEP621/631 support.
+ (Issue #1647)
- Fix error when when re-registering a formatter.
(PR #1629)
- Add new SI prefixes: ronna-, ronto-, quetta-, quecto-.
diff --git a/pint/pint-convert b/pint/pint_convert.py
index 600016b..b30bb94 100755
--- a/pint/pint-convert
+++ b/pint/pint_convert.py
@@ -170,4 +170,9 @@ def use_unc(num, fmt, prec_unc):
return max(0, min(prec_unc, unc))
-convert(args.fr, args.to)
+def main():
+ convert(args.fr, args.to)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/pyproject.toml b/pyproject.toml
index 771af68..3a63fc7 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,71 @@
[build-system]
-requires = ["setuptools>=41", "wheel", "setuptools_scm[toml]>=3.4.3"]
+requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=3.4.3"]
build-backend = "setuptools.build_meta"
[tool.setuptools_scm]
+
+[project]
+name = "Pint"
+authors = [
+ {name="Hernan E. Grecco", email="hernan.grecco@gmail.com"}
+]
+license = {text = "BSD"}
+description = "Physical quantities module"
+readme = "README.rst"
+maintainers = [
+ {name="Hernan E. Grecco", email="hernan.grecco@gmail.com"},
+ {name="Jules Chéron", email="julescheron@gmail.com"}
+]
+keywords = ["physical", "quantities", "unit", "conversion", "science"]
+classifiers = [
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "Intended Audience :: Science/Research",
+ "License :: OSI Approved :: BSD License",
+ "Operating System :: MacOS :: MacOS X",
+ "Operating System :: Microsoft :: Windows",
+ "Operating System :: POSIX",
+ "Programming Language :: Python",
+ "Topic :: Scientific/Engineering",
+ "Topic :: Software Development :: Libraries",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10",
+ "Programming Language :: Python :: 3.11"
+]
+requires-python = ">=3.8"
+dynamic = ["version"]
+
+[project.optional-dependencies]
+test = [
+ "pytest",
+ "pytest-mpl",
+ "pytest-cov",
+ "pytest-subtests"
+]
+numpy = ["numpy >= 1.19.5"]
+uncertainties = ["uncertainties >= 3.1.6"]
+babel = ["babel <= 2.8"]
+pandas = ["pint-pandas >= 0.3"]
+xarray = ["xarray"]
+dask = ["dask"]
+
+[project.urls]
+Homepage = "https://github.com/hgrecco/pint"
+Documentation = "https://pint.readthedocs.io/"
+
+[project.scripts]
+pint-convert = "pint.pint_convert:main"
+
+[tool.setuptools]
+packages = ["pint"]
+
+[tool.isort]
+profile = "black"
+default_section="THIRDPARTY"
+known_first_party="pint"
+multi_line_output=3
+include_trailing_comma=true
+force_grid_wrap=0
+use_parentheses=true
+line_length=88
diff --git a/setup.cfg b/setup.cfg
index 9ce8b48..ad731f9 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,55 +1,3 @@
-[metadata]
-name = Pint
-author = Hernan E. Grecco
-author_email = hernan.grecco@gmail.com
-license = BSD
-description = Physical quantities module
-long_description = file: README.rst
-keywords = physical, quantities, unit, conversion, science
-url = https://github.com/hgrecco/pint
-classifiers =
- Development Status :: 4 - Beta
- Intended Audience :: Developers
- Intended Audience :: Science/Research
- License :: OSI Approved :: BSD License
- Operating System :: MacOS :: MacOS X
- Operating System :: Microsoft :: Windows
- Operating System :: POSIX
- Programming Language :: Python
- Topic :: Scientific/Engineering
- Topic :: Software Development :: Libraries
- Programming Language :: Python :: 3.8
- Programming Language :: Python :: 3.9
- Programming Language :: Python :: 3.10
- Programming Language :: Python :: 3.11
-
-[options]
-packages = pint
-zip_safe = True
-include_package_data = True
-python_requires = >=3.8
-setup_requires = setuptools; setuptools_scm
-scripts = pint/pint-convert
-
-[options.extras_require]
-numpy = numpy >= 1.19.5
-uncertainties = uncertainties >= 3.1.6
-babel = babel <= 2.8
-pandas = pint-pandas >= 0.3
-xarray = xarray
-dask = dask
-test =
- pytest
- pytest-mpl
- pytest-cov
- pytest-subtests
-
-[options.package_data]
-pint = default_en.txt; constants_en.txt; py.typed
-
-[build-system]
-requires = ["setuptools", "setuptools_scm", "wheel"]
-
[flake8]
ignore=
# whitespace before ':' - doesn't work well with black
@@ -64,15 +12,6 @@ ignore=
exclude=
build
-[isort]
-default_section=THIRDPARTY
-known_first_party=pint
-multi_line_output=3
-include_trailing_comma=True
-force_grid_wrap=0
-use_parentheses=True
-line_length=88
-
[zest.releaser]
python-file-with-version = version.py
create-wheel = yes
diff --git a/setup.py b/setup.py
deleted file mode 100644
index f4f9665..0000000
--- a/setup.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python3
-from setuptools import setup
-
-if __name__ == "__main__":
- setup()