Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace deprecated usage of setup.py #373

Merged
merged 5 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine

- name: Check and get Version Number
id: get_version
Expand All @@ -39,7 +39,7 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_JM }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*

- name: Create Draft Release
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
# built documents.
#
# The short X.Y version.
version = re.match(r"v?(\d+\.\d+)", snewpy._version.__version__).group(1)
version = re.match(r"v?(\d+\.\d+)", snewpy.__version__).group(1)
# The full version, including alpha/beta/rc tags.
release = snewpy._version.__version__
release = snewpy.__version__

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "snewpy"
dynamic = ["version"]
description = "A Python package for working with supernova neutrinos"
authors = [{ name = "SNEWS Collaboration", email = "[email protected]" }]
license = { text = "BSD" }
readme = {file = "README.md", content-type = "text/markdown"}

requires-python = ">=3.9"

dependencies = [
"numpy",
"scipy",
"astropy >= 4.3",
"pandas",
"tqdm",
"matplotlib",
"h5py",
"requests",
"pyyaml",
"snowglobes_data == 1.3.2"
]

[project.optional-dependencies]
dev = ["hypothesis", "pytest"]
docs = ["numpydoc"]

[project.urls]
"Homepage" = "https://github.com/SNEWS2/snewpy"
"Bug Tracker" = "https://github.com/SNEWS2/snewpy/issues"


[tool.setuptools.dynamic]
version = {attr = "snewpy.__version__"}

[tool.setuptools.packages.find]
where = ["python"]
include = [
"snewpy",
"snewpy.*",
]
exclude = [
"snewpy.scripts",
]

[tool.setuptools.package-data]
"snewpy.models" = ["*.yml"]
5 changes: 4 additions & 1 deletion python/snewpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Front-end for supernova models which provide neutrino luminosity and spectra.
"""

from ._version import __version__
from sys import exit
import os

Expand All @@ -17,6 +16,10 @@
# when imported by setup.py before dependencies are installed
get_cache_dir = lambda: '.'


__version__ = '1.6b1'


src_path = os.path.realpath(__path__[0])
base_path = os.sep.join(src_path.split(os.sep)[:-2])
model_path = os.path.join(get_cache_dir(), 'snewpy', 'models')
Expand Down
179 changes: 0 additions & 179 deletions python/snewpy/_git.py

This file was deleted.

1 change: 0 additions & 1 deletion python/snewpy/_version.py

This file was deleted.

1 change: 0 additions & 1 deletion python/snewpy/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from .snewpy_test_suite import runtests
24 changes: 0 additions & 24 deletions python/snewpy/test/snewpy_test_suite.py

This file was deleted.

10 changes: 0 additions & 10 deletions requirements.txt

This file was deleted.

64 changes: 0 additions & 64 deletions setup.py

This file was deleted.

Loading