diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..f5b214f1 --- /dev/null +++ b/.flake8 @@ -0,0 +1,6 @@ +[flake8] +count = true +select = E9,F63,F7,F82 +show-source = true +statistics = true +exclude = .git,build,docs,scripts,binder \ No newline at end of file diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index e69a3f54..97a45e78 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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: diff --git a/docs/conf.py b/docs/conf.py index f258dc20..e8733ad1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -30,6 +30,8 @@ import datetime from importlib import import_module +import toml + try: from sphinx_astropy.conf.v1 import * # noqa except ImportError: @@ -37,11 +39,12 @@ 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 ---------------------------------------------------- @@ -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 @@ -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) ---- # diff --git a/pyproject.toml b/pyproject.toml index 706bf597..f0ee7e72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/scripts/README.rst b/scripts/README.rst index d3306440..3e97ccb3 100644 --- a/scripts/README.rst +++ b/scripts/README.rst @@ -1,2 +1,5 @@ Some files running various parts of the eazy-py code, e.g., for generating -templates and testing. \ No newline at end of file +templates and testing. + +*(Oct. 2024) NB:* These scripts haven't been used or tested in years and should be +considered deprecated. \ No newline at end of file diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fd7aeae3..00000000 --- a/setup.cfg +++ /dev/null @@ -1,72 +0,0 @@ -[metadata] -name = eazy -author = G. Brammer -author_email = gbrammer@gmail.com -description = Pythonic photo-zs -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://github.com/gbrammer/eazy-py -license = MIT -license_files = LICENSE.txt -project_urls = - Documentation = https://eazy-py.readthedocs.io/ - Source = https://github.com/gbrammer/eazy-py - Tracker = https://github.com/gbrammer/eazy-py/issues -classifiers= - Development Status :: 3 - Alpha - Intended Audience :: Science/Research - Topic :: Scientific/Engineering :: Astronomy - -[options] -python_requires = >=3.8 -install_requires = - numpy - scipy<1.14 - matplotlib - astropy - peakutils - tqdm - h5py - astro-sedpy>=0.3 - dust_extinction -packages = find: -include_package_data = True - -[options.extras_require] -test = - pytest>=5.1 - flake8 -docs = - sphinx - sphinx-astropy - dust_attenuation @ git+https://github.com/karllark/dust_attenuation.git - -[options.package_data] -eazy.data = - *.txt - alpha_lyr_stis_008.fits - emlines_info.dat - zphot.param.default - -[build_sphinx] -source-dir = docs -build-dir = docs/_build -all_files = 1 - -[build_docs] -source_dir = docs -build_dir = docs/_build -all_files = 1 - -[upload_docs] -upload-dir = docs/_build/html -show-response = 1 - -[tool:pytest] -minversion = 5.0 -norecursedirs = eazy-photoz build docs/build -testpaths = - eazy/tests - -[flake8] -exclude = *parsetab.py,conftest.py,docs/conf.py,scripts/*