Skip to content

Commit

Permalink
Update packaging to use pyproj and generate a dynamic version number (#…
Browse files Browse the repository at this point in the history
…385)

* convert most project metadata to pyproject.toml

* add setuptools_scm to environment

* drop version.txt

* Add __version__ to package

* force conda-forge

* tag docker with python version too

* Update pyproject.toml

Co-authored-by: dbekaert <[email protected]>

* Fix typo

Co-authored-by: dbekaert <[email protected]>
  • Loading branch information
jhkennedy and dbekaert authored Nov 10, 2022
1 parent 88e60bd commit 1585569
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 61 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ on:
- dev

jobs:
call-git-object-name-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
call-version-info-workflow:
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
conda_env_name: RAiDER

call-docker-ghcr-workflow:
needs: call-git-object-name-workflow
needs: call-version-info-workflow
uses: ASFHyP3/actions/.github/workflows/[email protected]
with:
version_tag: ${{ needs.call-git-object-name-workflow.outputs.name }}
version_tag: ${{ needs.call-version-info-workflow.outputs.version_tag }}
release_branch: main
develop_branch: dev
user: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
name: RAiDER
channels:
- conda-forge
- anaconda
- defaults
- nodefaults
dependencies:
- python>=3.8
- pip
Expand Down Expand Up @@ -44,3 +43,4 @@ dependencies:
- pytest-cov
- pytest-timeout
- pytest-console-scripts
- setuptools_scm >=6.2
49 changes: 48 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,61 @@
[build-system]
requires =[
"setuptools>=42",
"setuptools>=61.0",
"setuptools_scm[toml]>=6.2",
"wheel",
"numpy",
"cython",
"pybind11>=2.5.0"
]
build-backend = "setuptools.build_meta"

[project]
name = "RAiDER"
authors = [
{name="David Bekaert", email="[email protected]"},
{name="Jeremy Maurer", email="[email protected]"},
{name="Piyush Agram", email="[email protected]"},
{name="Simran Sangha", email="[email protected]"}
]
description = "Raytracing Atmospheric Delay Estimation for RADAR"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "Apache License 2.0"}
classifiers=[
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
# dependencies = []
dynamic = ["version"]

[project.urls]
homepage = "https://github.com/dbekaert/RAiDER"
documentation = "https://github.com/dbekaert/RAiDER-docs"
repository = "https://github.com/dbekaert/RAiDER"
"Bug Tracker" = "https://github.com/dbekaert/RAiDER/issues"

[project.scripts]
"generateGACOSVRT.py" = "RAiDER.models.generateGACOSVRT:main"
"raiderDelay.py" = "RAiDER.runProgram:main"
"prepARIA.py" = "RAiDER.prepFromAria:main"
"raiderCombine.py" = "RAiDER.gnss.processDelayFiles:main"
"raiderStats.py" = "RAiDER.statsPlot:main"
"raiderDownloadGNSS.py" = "RAiDER.downloadGNSSDelays:main"

[tool.setuptools]
zip-safe = false

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

[tool.isort]
known_first_party = "RAiDER"
multi_line_output = 5
default_section = "THIRDPARTY"

[tool.setuptools_scm]
49 changes: 2 additions & 47 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,14 @@

import numpy as np
from pybind11.setup_helpers import Pybind11Extension, build_ext
from setuptools import Extension, find_packages, setup
from setuptools import Extension, setup

# Cythonize should be imported after setuptools. See:
# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#configuring-the-c-build
from Cython.Build import cythonize # isort:skip

# Parameter defs
UTIL_DIR = Path.cwd() / 'tools' / 'bindings' / 'utils'


def get_version():
with open('version.txt', 'r') as f:
m = re.match("""version=['"](.*)['"]""", f.read())

assert m, "Malformed 'version.txt' file!"
return m.group(1)

UTIL_DIR = Path('tools') / 'bindings' / 'utils'

pybind_extensions = [
Pybind11Extension(
Expand All @@ -51,42 +42,6 @@ def get_version():
)

setup(
name='RAiDER',
version=get_version(),
description='Raytracing Atmospheric Delay Estimation for RADAR',
long_description=(Path(__file__).parent / 'README.md').read_text(),
long_description_content_type='text/markdown',
url='https://github.com/dbekaert/RAiDER',

license='Apache License 2.0',
classifiers=[
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
],

python_requires='~=3.8',
# install_requires=[],

package_dir={'': 'tools'},
packages=find_packages('tools'),

ext_modules=cython_extensions + pybind_extensions,
cmdclass={"build_ext": build_ext},

entry_points={
'console_scripts': [
'generateGACOSVRT.py = RAiDER.models.generateGACOSVRT:main',
'raiderDelay.py = RAiDER.runProgram:main',
'prepARIA.py = RAiDER.prepFromAria:main',
'raiderCombine.py = RAiDER.gnss.processDelayFiles:main',
'raiderStats.py = RAiDER.statsPlot:main',
'raiderDownloadGNSS.py = RAiDER.downloadGNSSDelays:main',
]
},
zip_safe=False,
)
9 changes: 3 additions & 6 deletions tools/RAiDER/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
Copyright (c) 2019-2022, California Institute of Technology ("Caltech"). All rights reserved.
"""
from importlib.metadata import version

# Import compiled modules so we can do something like
#
# import RAiDER
# RAiDER.Geo2rdr
# from RAiDER import interpolate, makePoints
__version__ = version(__name__)
__copyright__ = 'Copyright (c) 2019-2022, California Institute of Technology ("Caltech"). All rights reserved.'
# __all__ = ['interpolate', 'makePoints', __copyright__]

__all__ = ['__version__', '__copyright__']
1 change: 0 additions & 1 deletion version.txt

This file was deleted.

0 comments on commit 1585569

Please sign in to comment.