-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop Python 3.7, support 3.11, improve installation (#134)
- Require Python 3.8 as minimum version - Remove `setup.py` and create `pyproject.toml` - Do not run CI tests with Python 3.7 - Run CI tests with Python 3.11 - Read `__version__` in "smart" way: either from metadata of installed package, or directly from `pyproject.toml` - Update package version to 0.17.2
- Loading branch information
Showing
4 changed files
with
67 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
[build-system] | ||
requires = ["setuptools >= 64.0", "wheel"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "sympde" | ||
version = "0.17.2" | ||
description = "Symbolic calculus for partial differential equations (and variational forms)" | ||
readme = "README.rst" | ||
requires-python = ">= 3.8, < 3.12" | ||
license = {file = "LICENSE"} | ||
authors = [{name = "Ahmed Ratnani", email = "ratnaniahmed@gmail.com"}] | ||
maintainers = [ | ||
{name = "Yaman Güçlü", email = "yaman.guclu@gmail.com"}, | ||
{name = "Said Hadjout"}, | ||
] | ||
keywords = ["math"] | ||
classifiers = ["Programming Language :: Python :: 3"] | ||
dependencies = [ | ||
'sympy >= 1.2, < 1.7', | ||
'h5py', | ||
'pytest', | ||
'pyyaml', | ||
'numpy', | ||
'matplotlib' | ||
] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/pyccel/sympde" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["sympde*"] | ||
namespaces = false | ||
|
||
[tool.setuptools.package-data] | ||
"*" = ["README.rst"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,30 @@ | ||
__version__ = "0.17.1" | ||
def extract_version() -> str: | ||
""" | ||
Returns either the version of the installed package (e.g. "0.17.1") or the | ||
one found in pyproject.toml (e.g. "0.17.1-dev (at /project/location)"). | ||
Returns | ||
------- | ||
str | ||
The package version. | ||
See also | ||
-------- | ||
https://stackoverflow.com/a/76206192 | ||
""" | ||
from contextlib import suppress | ||
from pathlib import Path | ||
|
||
with suppress(FileNotFoundError, StopIteration): | ||
root_dir = Path(__file__).parent.parent | ||
with open(root_dir / "pyproject.toml", encoding="utf-8") as pyproject_toml: | ||
version_line = next(line for line in pyproject_toml if line.startswith("version")) | ||
version = version_line.split("=")[1].strip("'\"\n ") | ||
return f"{version}-dev (at {root_dir})" | ||
|
||
import importlib.metadata | ||
return importlib.metadata.version(__package__) | ||
|
||
|
||
__version__ = extract_version() |