File tree Expand file tree Collapse file tree 4 files changed +19
-36
lines changed Expand file tree Collapse file tree 4 files changed +19
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11[build-system ]
2- requires = [
3- " setuptools>=77.0.0" ,
4- " setuptools_scm[toml]>=7.0.1" ,
5- ]
6-
7- build-backend = " setuptools.build_meta"
2+ requires = [" flit_core >=3.11,<4" ]
3+ build-backend = " flit_core.buildapi"
84
95[project ]
106name = " unyt"
7+ version = " 3.0.1dev0"
118description = " A package for handling numpy arrays with units"
129authors = [
1310 {
name =
" The yt project" ,
email =
" [email protected] " },
@@ -31,9 +28,6 @@ dependencies = [
3128 " sympy>=1.9.0" ,
3229 " packaging>=20.9" ,
3330]
34- dynamic = [
35- " version" ,
36- ]
3731
3832[project .readme ]
3933file = " README.rst"
@@ -87,24 +81,14 @@ required-environments = [
8781 " sys_platform == 'darwin' and platform_machine == 'arm64'" ,
8882]
8983
90- [tool .setuptools ]
91- include-package-data = true
92- zip-safe = false
9384
94- [tool .setuptools . packages . find ]
85+ [tool .flit . sdist ]
9586include = [
9687 " unyt" ,
9788 " unyt.tests" ,
9889 " unyt.tests.data" ,
9990 " unyt._mpl_array_converter" ,
10091]
101- namespaces = false
102-
103- [tool .setuptools .package-data ]
104- unyt = [
105- " tests/data/old_json_registry.txt" ,
106- ]
107-
10892
10993[tool .black ]
11094exclude = '''
@@ -154,10 +138,6 @@ select = [
154138[tool .ruff .lint .isort ]
155139combine-as-imports = true
156140
157- [tool .setuptools_scm ]
158- write_to = " unyt/_version.py"
159- version_scheme = " post-release"
160-
161141[tool .pytest .ini_options ]
162142addopts = " -ra --ignore=benchmarks --ignore=paper --ignore=unyt/_mpl_array_converter --color=yes"
163143filterwarnings = [
Original file line number Diff line number Diff line change 5858from unyt .unit_registry import UnitRegistry # NOQA: F401
5959from unyt .unit_systems import UnitSystem # NOQA: F401
6060
61- from ._version import __version__
62-
6361
6462# function to only import quantities into this namespace
6563# we go through the trouble of doing this instead of "import *"
@@ -95,3 +93,10 @@ def test(): # pragma: no cover
9593from unyt .mpl_interface import matplotlib_support
9694
9795matplotlib_support = matplotlib_support ()
96+
97+
98+ def __getattr__ (item : str ):
99+ if item == "__version__" :
100+ from importlib .metadata import version
101+ return version ("unyt" )
102+ raise AttributeError (f"Module 'unyt' has no attribute { item !r} ." )
Original file line number Diff line number Diff line change 1+ from importlib .metadata import version
2+
3+ import unyt
4+
5+
6+ def test_version ():
7+ expected = version ("unyt" )
8+ assert unyt .__version__ == expected
You can’t perform that action at this time.
0 commit comments