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

Update package build system to hatchling #729

Merged
merged 3 commits into from
Jan 14, 2025
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
35 changes: 6 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,16 @@ nosetests.xml
*.out
*.app

# various built ms2gt files
ms2gt/src/fornav/fornav
ms2gt/src/grid_convert/grid_convert
ms2gt/src/gridsize/gridsize
ms2gt/src/ll2cr/ll2cr
ms2gt/src/ll2xy/ll2xy
ms2gt/src/lle2cre/lle2cre
ms2gt/src/mapx/trunk/cdb_edit
ms2gt/src/mapx/trunk/cdb_list
ms2gt/src/mapx/trunk/crtest
ms2gt/src/mapx/trunk/gacct
ms2gt/src/mapx/trunk/gridloc
ms2gt/src/mapx/trunk/gtest
ms2gt/src/mapx/trunk/irregrid
ms2gt/src/mapx/trunk/macct
ms2gt/src/mapx/trunk/mapenum
ms2gt/src/mapx/trunk/mtest
ms2gt/src/mapx/trunk/regrid
ms2gt/src/mapx/trunk/resamp
ms2gt/src/mapx/trunk/ungrid
ms2gt/src/mapx/trunk/wdbtocdb
ms2gt/src/mapx/trunk/xytest
ms2gt/src/projection/projection
ms2gt/src/utils/apply_mask
ms2gt/src/utils/extract_region
ms2gt/src/utils/insert_region
ms2gt/src/utils/make_mask
ms2gt/src/xy2ll/xy2ll

# PyCharm configs
.idea

# Image Editing Tools
*.xcf

# Example images should not be added to the repository
doc/source/_static/example_images
doc/source/dev_guide/api/*.rst
doc/source/grids_list.rst

# Polar2Grid Bundles being compared against
polar2grid-swbundle-*
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

4 changes: 0 additions & 4 deletions create_conda_software_bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ for bash_file in *.sh; do
sed -i "s/# __SWBUNDLE_ENVIRONMENT_INJECTION__/source \$POLAR2GRID_HOME\/bin\/env.sh/g" "$bash_file"
done

# Softlink bin/ scripts in python runtime so env.sh adds them to PATH
cd ${PYTHON_RUNTIME_BASE}/bin
find ../../../bin/ -name "*.sh" ! -name "*env*" -exec ln -s {} . \;

echo "Copying Satpy auxiliary data to software bundle..."
mkdir -p ${SATPY_DATA_DIR} || oops "Could not create polar2grid auxiliary data directory"
# don't include large geotiff files that we don't use in P2G/G2G
Expand Down
30 changes: 24 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "polar2grid"
Expand Down Expand Up @@ -50,11 +50,29 @@ Project-URL = "https://github.com/ssec/polar2grid/"
polar2grid = "polar2grid.__main__:p2g_main"
geo2grid = "polar2grid.__main__:g2g_main"

[tool.setuptools]
include-package-data = true
[tool.hatch.build.targets.sdist]
only-include = [
"polar2grid",
"NEWS.rst",
"NEWS_GEO2GRID.rst",
"swbundle",
]

[tool.hatch.build.targets.wheel]
packages = ["polar2grid"]

[tool.setuptools.packages]
find = {}
[tool.hatch.build.targets.wheel.shared-scripts]
"swbundle/add_coastlines.sh" = "add_coastlines.sh"
"swbundle/add_colormap.sh" = "add_colormap.sh"
"swbundle/convert_grids_conf_to_yaml.sh" = "convert_grids_conf_to_yaml.sh"
"swbundle/download_pyspectral_data.sh" = "download_pyspectral_data.sh"
"swbundle/geo2grid.sh" = "geo2grid.sh"
"swbundle/gtiff2kmz.sh" = "gtiff2kmz.sh"
"swbundle/gtiff2mp4.sh" = "gtiff2mp4.sh"
"swbundle/overlay.sh" = "overlay.sh"
"swbundle/p2g_compare.sh" = "p2g_compare.sh"
"swbundle/p2g_grid_helper.sh" = "p2g_grid_helper.sh"
"swbundle/polar2grid.sh" = "polar2grid.sh"

[tool.pytest.ini_options]
minversion = 6.0
Expand Down
Loading