Skip to content

Commit

Permalink
Move package definition to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
simontorres committed Jul 19, 2024
1 parent 288fd4c commit 8749532
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 148 deletions.
2 changes: 0 additions & 2 deletions goodman_pipeline/version.py

This file was deleted.

90 changes: 90 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[build-system]
requires = ["setuptools>=64", "setuptools_scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "goodman_pipeline"
dynamic = ["version"]
description = "Pipeline for reducing Goodman HTS data."
readme = "README.md"
requires-python = ">=3.8"
license = {file = "LICENSE"}
keywords = [
"soar",
"pipelines",
"astronomy",
"images",
"spectroscopy"
]

authors = [
{name = "Simón Torres", email = "[email protected]"},
{name = "Bruno Quint", email = "[email protected]"},
{name = "César Briceño", email = "[email protected]"},
{name = "David Sanmartim", email = "[email protected]"}
]
maintainers = [
{name = "Simón Torres", email = "[email protected]"}
]

classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: Other',
'Operating System :: MacOS :: MacOS X',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development :: Libraries :: Python Modules',
]

dependencies = [
"numpy",
"pandas",
"matplotlib",
"scipy",
"cython",
"astropy",
"ccdproc",
"astroplan"
]


[project.urls]
"Homepage" = "https://soardocs.readthedocs.io/projects/goodman-pipeline/en/latest/"
"Bug Reports" = "https://github.com/soar-telescope/goodman_pipeline/issues"
"Source" = "https://github.com/soar-telescope/goodman_pipeline"

[project.scripts]
redccd = "goodman_pipeline.scripts.redccd"
redspec = "goodman_pipeline.scripts.redspec"


[tool.setuptools]
[tool.setuptools.packages.find]
where = ["goodman_pipeline"]

[tool.setuptools.package-data]
goodman_pipeline = [
'data/params/dcr.par',
'data/params/*.json_output',
'data/ref_comp/*fits',
'data/dcr_source/README.md',
'data/dcr_source/dcr/*',
'data/test_data/master_flat/*',
'data/test_data/wcs_data/*'
]


[tool.setuptools_scm]
version_file = "goodman_pipeline/version.py"
147 changes: 1 addition & 146 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,151 +8,6 @@
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""

import os

# Always prefer setuptools over distutils
from setuptools import setup

# To use a consistent encoding
from codecs import open


here = os.path.abspath(os.path.dirname(__file__))


def create_version_py(packagename, version, source_dir='.'):
package_dir = os.path.join(source_dir, packagename)
version_py = os.path.join(package_dir, 'version.py')

version_str = "# This is an automatic generated file please do not edit\n" \
"__version__ = '{:s}'".format(version)

with open(version_py, 'w') as f:
f.write(version_str)


# read content from README.md
with open(os.path.join(here, 'README.md')) as f:
long_description = f.read()


# Get configuration information from setup.cfg
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
conf = ConfigParser()


# conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
conf.read([os.path.join(os.path.dirname(__file__), 'setup.cfg')])
metadata = dict(conf.items('metadata'))

PACKAGENAME = metadata['package_name']

VERSION = metadata['version']

LICENSE = metadata['license']

DESCRIPTION = metadata['description']

LONG_DESCRIPTION = long_description

LONG_DESCRIPTION_CONTENT_TYPE = 'text/markdown'

AUTHOR = metadata['author']

AUTHOR_EMAIL = metadata['author_email']

INSTALL_REQUIRES = metadata['install_requires'].split()

# freezes version information in version.py
create_version_py(PACKAGENAME, VERSION)

setup(
name=metadata['package_name'],

# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version=VERSION,

description=DESCRIPTION,

long_description=LONG_DESCRIPTION,

long_description_content_type=LONG_DESCRIPTION_CONTENT_TYPE,

# The project's main homepage.
url='https://github.com/soar-telescope/goodman_pipeline',

# Author details
author=u'Simon Torres R., '
u'Bruno Quint, '
u'Cesar Briceño, '
u'David Sanmartin, ',

author_email='[email protected], [email protected], '
'[email protected]',

# Choose your license
license=LICENSE,

# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',

# Indicate who your project is intended for
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',

'License :: OSI Approved :: BSD License',

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',

'Natural Language :: English',

'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: Other',
'Operating System :: MacOS :: MacOS X',

'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development :: Libraries :: Python Modules',

],

# What does your project relate to?
keywords='soar pipelines astronomy images spectroscopy',

# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().

packages=['goodman_pipeline',
'goodman_pipeline.core',
'goodman_pipeline.images',
'goodman_pipeline.spectroscopy',
'goodman_pipeline.wcs', ],

package_dir={'goodman_pipeline': 'goodman_pipeline'},

package_data={'goodman_pipeline': ['data/params/dcr.par',
'data/params/*.json_output',
'data/ref_comp/*fits',
'data/dcr_source/README.md',
'data/dcr_source/dcr/*',
'data/test_data/master_flat/*',
'data/test_data/wcs_data/*']},

install_requires=INSTALL_REQUIRES,

scripts=['goodman_pipeline/scripts/redccd',
'goodman_pipeline/scripts/redspec', ],

)
setup()

0 comments on commit 8749532

Please sign in to comment.