Skip to content

Commit a22bf5e

Browse files
author
Matthias Wittgen
committed
Add upload to pypi
1 parent 161b0bc commit a22bf5e

File tree

3 files changed

+127
-27
lines changed

3 files changed

+127
-27
lines changed

.github/workflows/build.yaml

+92
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
tags:
8+
- "*"
79
pull_request:
810

911
jobs:
@@ -29,3 +31,93 @@ jobs:
2931
3032
- name: Run tests
3133
run: pytest -r a -v
34+
35+
pypi_sdist_build:
36+
runs-on: ubuntu-latest
37+
needs: [build_and_test]
38+
if: startsWith(github.ref, 'refs/tags/')
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0
43+
cache: "pip"
44+
cache-dependency-path: "setup.cfg"
45+
46+
- name: Set up Python
47+
uses: actions/setup-python@v3
48+
with:
49+
python-version: 3.8
50+
cache: "pip"
51+
cache-dependency-path: "setup.cfg"
52+
53+
- name: Install dependencies
54+
run: |
55+
pip install --upgrade setuptools wheel build
56+
57+
- name: Build and create distribution
58+
run: |
59+
python -m build --sdist
60+
61+
- uses: actions/upload-artifact@v3
62+
with:
63+
path: dist/*
64+
65+
pypi_wheel_build:
66+
strategy:
67+
matrix:
68+
os: ["ubuntu-latest", "macOS-10.15"]
69+
runs-on: ${{ matrix.os }}
70+
needs: [build_and_test]
71+
if: startsWith(github.ref, 'refs/tags/')
72+
env:
73+
CIBW_BUILD: "cp3{8,9,10}-{manylinux_x86_64,manylinux_aarch64,macosx_arm64,macosx_x86_64}"
74+
CIBW_ARCHS_MACOS: "x86_64 arm64"
75+
# use line below to enable aarch64 builds
76+
# CIBW_ARCHS_LINUX: "auto aarch64"
77+
CIBW_ARCHS_LINUX: "auto"
78+
79+
steps:
80+
# uncomment when building aarch64
81+
#- name: Set up QEMU
82+
# uses: docker/setup-qemu-action@v2
83+
# if: runner.os == 'Linux'
84+
# with:
85+
# platforms: arm64
86+
87+
- uses: actions/checkout@v3
88+
with:
89+
# Need to clone everything to embed the versiona
90+
fetch-depth: 0
91+
cache: "pip"
92+
cache-dependency-path: "setup.cfg"
93+
94+
- name: Set up Python
95+
uses: actions/setup-python@v3
96+
with:
97+
python-version: 3.8
98+
cache: "pip"
99+
cache-dependency-path: "setup.cfg"
100+
101+
- name: Install dependencies
102+
run: |
103+
pip install --upgrade setuptools wheel cibuildwheel
104+
105+
- name: Build and create distribution
106+
run: |
107+
python -m cibuildwheel --output-dir dist
108+
- uses: actions/upload-artifact@v3
109+
with:
110+
path: dist/*
111+
112+
pipy_upload:
113+
needs: [pypi_sdist_build, pypi_wheel_build]
114+
runs-on: ubuntu-latest
115+
steps:
116+
- uses: actions/download-artifact@v3
117+
with:
118+
name: artifact
119+
path: dist
120+
- uses: pypa/gh-action-pypi-publish@release/v1
121+
with:
122+
user: __token__
123+
password: ${{ secrets.PYPI_UPLOADS }}

README.md

+17-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphgeom: spherical geometry primitives {#mainpage}
1+
sphgeom: spherical geometry primitives
22
======================================
33

44
Overview
@@ -23,29 +23,25 @@ Python bindings that expose most of the C++ API are also provided via
2323
Points
2424
------
2525

26-
There are 3 different classes for points -
27-
[LonLat](\ref lsst::sphgeom::LonLat) for spherical coordinates,
28-
[Vector3d](\ref lsst::sphgeom::Vector3d) for Cartesian vectors in ℝ³
29-
(not constrained to lie on the unit sphere), and
30-
[UnitVector3d](\ref lsst::sphgeom::UnitVector3d) for vectors in ℝ³ with
31-
unit ℓ² norm.
26+
There are 3 different classes for points
27+
28+
- *LonLat* for spherical coordinates,
29+
- *Vector3d* for Cartesian vectors in ℝ³ (not constrained to lie on the unit sphere)
30+
- *UnitVector3d* for vectors in ℝ³ with unit ℓ² norm.
3231

3332
Regions
3433
-------
3534

36-
Four basic spherical [Region](\ref lsst::sphgeom::Region) types are
35+
Four basic spherical *Region* types are
3736
provided:
3837

39-
- [Box](\ref lsst::sphgeom::Box), a longitude/latitude angle box
40-
- [Circle](\ref lsst::sphgeom::Circle), a small circle defined
41-
by a center and opening angle/chord length
42-
- [Ellipse](\ref lsst::sphgeom::Ellipse), the intersection of an
43-
elliptical cone with the unit sphere
44-
- [ConvexPolygon](\ref lsst::sphgeom::ConvexPolygon), a convex
45-
spherical polygon with unit vector vertices and great circle edges
38+
- *Box*, a longitude/latitude angle box
39+
- *Circle*, a small circle defined by a center and opening angle/chord length
40+
- *Ellipse*, the intersection of an elliptical cone with the unit sphere
41+
- *ConvexPolygon*, a convex spherical polygon with unit vector vertices and great circle edges
4642

4743
In addition to the spherical regions, there is a type for 3-D axis aligned
48-
boxes, [Box3d](\ref lsst::sphgeom::Box3d). All spherical regions know how
44+
boxes, *Box3d*. All spherical regions know how
4945
to compute their 3-D bounding boxes, which makes it possible to insert them
5046
into a 3-D [R-tree](https://en.wikipedia.org/wiki/R-tree). This is used by the
5147
exposure indexing task in the [daf_ingest](https://github.com/lsst/daf_ingest)
@@ -54,23 +50,22 @@ package to spatially index exposure bounding polygons using the
5450
[R*tree module](https://www.sqlite.org/rtree.html).
5551

5652
A region can also determine its spatial
57-
[relationship](\ref lsst::sphgeom::Relationship) to another region, and
53+
relationship to another region, and
5854
test whether or not it contains a given unit vector.
5955

6056
Pixelizations
6157
-------------
6258

6359
This library also provides support for assigning points to pixels (a.k.a.
64-
cells or partitions) in a [Pixelization](\ref lsst::sphgeom::Pixelization)
60+
cells or partitions) in a *Pixelization*
6561
(a.k.a. partitioning) of the sphere, and for determining which pixels
6662
intersect a region.
6763

68-
Currently, the [Chunker](\ref lsst::sphgeom::Chunker) class implements
64+
Currently, the *Chunker* class implements
6965
the partitioning scheme employed by [Qserv](https://github.com/lsst/qserv).
70-
The [HtmPixelization](\ref lsst::sphgeom::HtmPixelization) class implements
66+
The *HtmPixelization* class implements
7167
the HTM (Hierarchical Triangular Mesh) pixelization. The
72-
[Q3cPixelization](\ref lsst::sphgeom::Q3cPixelization) and
73-
[Mq3cPixelization](\ref lsst::sphgeom::Mq3cPixelization) classes implement
68+
*Q3cPixelization* and *Mq3cPixelization* classes implement
7469
the original Quad Tree Cube indexing scheme and a modified version with
7570
reduced pixel area variation.
7671

setup.cfg

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
[metadata]
2-
name = lsst_sphgeom
2+
name = lsst-sphgeom
33
description = A spherical geometry library.
4-
author = LSST Data Management
5-
author_email = support@lsst.org
4+
author = Rubin Observatory Data Management
5+
author_email = dm-admin@lists.lsst.org
66
url = https://github.com/lsst/sphgeom
7+
license = GPLv3+ License
78
classifiers =
89
Intended Audience :: Science/Research
910
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
10-
Operating System :: OS Independent
11+
Operating System :: POSIX :: Linux
12+
Operating System :: MacOS :: MacOS X
1113
Programming Language :: Python :: 3
12-
Programming Language :: Python :: 3.7
14+
Programming Language :: Python :: 3.8
15+
Programming Language :: Python :: 3.9
16+
Programming Language :: Python :: 3.10
1317
Topic :: Scientific/Engineering :: Astronomy
18+
readme = file: README.md
19+
long_description = file: README.md
20+
long_description_content_type = text/markdown
21+
22+
keywords =
23+
lsst
1424

1525
[options]
1626
zip_safe = False
27+
python_requires = >=3.8
1728
package_dir=
1829
=python
1930
packages=find:
31+
setup_requires =
32+
setuptools >=46.0
2033
install_requires =
2134
numpy >=1.18
2235
healpy

0 commit comments

Comments
 (0)