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

Migrate to pyproject.toml file #51

Merged
merged 5 commits into from
Oct 25, 2024
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
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
count = true
select = E9,F63,F7,F82
show-source = true
statistics = true
exclude = .git,build,docs,scripts,binder
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
pip install flake8
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 .
test:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
17 changes: 10 additions & 7 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,21 @@
import datetime
from importlib import import_module

import toml

try:
from sphinx_astropy.conf.v1 import * # noqa
except ImportError:
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
sys.exit(1)

# Get configuration information from setup.cfg
from configparser import ConfigParser
conf = ConfigParser()
# from configparser import ConfigParser
# conf = ConfigParser()
# conf.read([os.path.join(os.path.dirname(__file__), '..', 'pyproject.toml')])
# setup_cfg = dict(conf.items('metadata'))

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))
setup_cfg = toml.load("../pyproject.toml")["project"]

# -- General configuration ----------------------------------------------------

Expand All @@ -68,9 +71,9 @@

# This does not *have* to match the package name, but typically does
project = setup_cfg['name']
author = setup_cfg['author']
author = setup_cfg['authors'][0]['name']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, setup_cfg['author'])
datetime.datetime.now().year, author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -152,7 +155,7 @@
[author], 1)]

# -- Resolving issue number to links in changelog -----------------------------
github_issues_url = f"{setup_cfg['url']}/issues/"
github_issues_url = setup_cfg['urls']['Tracker']

# -- Turn on nitpicky mode for sphinx (to warn about references not found) ----
#
Expand Down
54 changes: 52 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
[build-system]
requires = ["setuptools>=43.0.0", "setuptools_scm[toml]>=6.2", "wheel"]
requires = ["setuptools >= 64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "eazy"
dynamic = ["version"]
description = "Pythonic photo-zs"
readme = "README.rst"
license = {file = "LICENSE.txt"}
requires-python = ">=3.8"
authors = [
{ name = "G. Brammer", email = "gbrammer@gmail.com" },
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",
]
dependencies = [
"astro-sedpy>=0.3",
"astropy",
"dust_extinction",
"h5py",
"matplotlib",
"numpy",
"peakutils",
"scipy<1.14",
"tqdm",
"dust_attenuation @ git+https://github.com/karllark/dust_attenuation.git",
]

[project.optional-dependencies]
docs = [
"sphinx",
"sphinx-astropy",
"toml",
]
test = [
"flake8",
"pytest>=5.1",
"coverage",
]

[project.urls]
Documentation = "https://eazy-py.readthedocs.io/"
Homepage = "https://github.com/gbrammer/eazy-py"
Source = "https://github.com/gbrammer/eazy-py"
Tracker = "https://github.com/gbrammer/eazy-py/issues"

[tool.setuptools]
packages = ["eazy"]
package-data = {eazy = ["data/*", "data/templates/*", "data/filters/*"]}

[tool.setuptools_scm]
write_to = "eazy/version.py"
version_file = "eazy/version.py"
5 changes: 4 additions & 1 deletion scripts/README.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
Some files running various parts of the eazy-py code, e.g., for generating
templates and testing.
templates and testing.

*(Oct. 2024) NB:* These scripts haven't been used or tested in years and should be
considered deprecated.
72 changes: 0 additions & 72 deletions setup.cfg

This file was deleted.

Loading