-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from nasa/HARMONY-1866-generate-reformatting-f…
…ilename HARMONY-1866 - Enable _reformatted prefix in output file names. HARMONY-1908 - Modernise packaging to use pyproject.toml.
- Loading branch information
Showing
6 changed files
with
131 additions
and
92 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
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,37 @@ | ||
# License and classifier list: | ||
# https://pypi.org/pypi?%3Aaction=list_classifiers | ||
|
||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
authors = [ | ||
{name = "NASA EOSDIS Harmony Team", email = "[email protected]"} | ||
] | ||
classifiers = [ | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
] | ||
description = "A library for Python-based Harmony services to parse incoming message, fetch data, stage data, and call back to Harmony." | ||
dynamic = ["dependencies", "optional-dependencies", "version"] | ||
license = { text = "License :: OSI Approved :: Apache Software License" } | ||
name = "harmony-service-lib" | ||
readme = "README.md" | ||
requires-python = ">= 3.8" | ||
|
||
[project.scripts] | ||
harmony-service-lib = "harmony.cli.__main__:main" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/nasa/harmony-service-lib-py" | ||
|
||
[tool.setuptools.dynamic] | ||
dependencies = {file = ["requirements.txt"]} | ||
optional-dependencies = {dev = {file = ["dev-requirements.txt"]}} | ||
# Will read __version__ from harmony.__init__.py | ||
version = {attr = "harmony.__version__"} | ||
|
||
[tool.setuptools.packages.find] | ||
exclude = ["contrib", "docs", "tests*"] |
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 |
---|---|---|
|
@@ -7,68 +7,9 @@ | |
# To upload this file to PyPI you must build it then upload it: | ||
# python setup.py sdist bdist_wheel # build in 'dist' folder | ||
# python-m twine upload dist/* # 'twine' must be installed: 'pip install twine' | ||
# | ||
# 2024-09-24 - Updated to use pyproject.toml. | ||
|
||
import ast | ||
import io | ||
import re | ||
import os | ||
from setuptools import find_packages, setup | ||
from setuptools import setup | ||
|
||
DEPENDENCIES = [] | ||
with open("requirements.txt", "r") as f: | ||
DEPENDENCIES = f.read().strip().split('\n') | ||
|
||
DEV_DEPENDENCIES = [] | ||
with open("dev-requirements.txt", "r") as f: | ||
DEV_DEPENDENCIES = f.read().strip().split('\n') | ||
|
||
EXCLUDE_FROM_PACKAGES = ["contrib", "docs", "tests*"] | ||
CURDIR = os.path.abspath(os.path.dirname(__file__)) | ||
|
||
with io.open(os.path.join(CURDIR, "README.md"), "r", encoding="utf-8") as f: | ||
README = f.read() | ||
|
||
|
||
def get_version(): | ||
main_file = os.path.join(CURDIR, "harmony", "__init__.py") | ||
_version_re = re.compile(r"__version__\s+=\s+(?P<version>.*)") | ||
with open(main_file, "r", encoding="utf8") as f: | ||
match = _version_re.search(f.read()) | ||
version = match.group("version") if match is not None else '"unknown"' | ||
return str(ast.literal_eval(version)) | ||
|
||
|
||
setup( | ||
name="harmony-service-lib", | ||
version=get_version(), | ||
author="NASA EOSDIS Harmony Team", | ||
author_email="[email protected]", | ||
description=("A library for Python-based Harmony services to parse incoming messages, " | ||
"fetch data, stage data, and call back to Harmony"), | ||
long_description=README, | ||
long_description_content_type="text/markdown", | ||
url="https://github.com/nasa/harmony-service-lib-py", | ||
packages=find_packages(exclude=EXCLUDE_FROM_PACKAGES), | ||
include_package_data=True, | ||
keywords=[], | ||
scripts=[], | ||
entry_points={ | ||
"console_scripts": ["harmony-service-lib=harmony.cli.__main__:main"] | ||
}, | ||
zip_safe=False, | ||
install_requires=DEPENDENCIES, | ||
# HARMONY-1188 - uncomment this | ||
# extras_require={ | ||
# 'dev': DEV_DEPENDENCIES | ||
# }, | ||
test_suite="tests", | ||
python_requires=">=3.8", | ||
# license and classifier list: | ||
# https://pypi.org/pypi?%3Aaction=list_classifiers | ||
license="License :: OSI Approved :: Apache Software License", | ||
classifiers=[ | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent" | ||
], | ||
) | ||
setup() |
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