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

DM-32408: Enable version detection for setuptools build #36

Merged
merged 2 commits into from
Apr 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: build_and_test

on:
- push
- pull_request
push:
branches:
- main
pull_request:

jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Need to clone everything to determine version from git.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.8
cache: "pip"
cache-dependency-path: "setup.cfg"

- name: Build and install
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/cmake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ jobs:
cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
# Need to clone everything to determine version from git.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.8

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: lint

on:
- push
- pull_request
push:
branches:
- main
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: 3.7
python-version: 3.8

- name: Install
run: pip install -r <(curl https://raw.githubusercontent.com/lsst/linting/main/requirements.txt)
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ requires = [
"wheel",
"pybind11 >= 2.5.0",
"numpy >= 1.18",
"lsst-versions",
]

[tool.lsst_versions]
write_to = "python/lsst/sphgeom/version.py"
12 changes: 0 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension, build_ext

# Currently a fake version for testing
version = '0.0.1'

# To enable consistency with sconsUtils we write the version to the
# same location
with open("./python/lsst/sphgeom/version.py", "w") as f:
print(f"""
__all__ = ("__version__", )
__version__ = '{version}'""", file=f)


# Find the source code -- we can combine it into a single module
pybind_src = sorted(glob.glob("python/lsst/sphgeom/*.cc"))
cpp_src = sorted(glob.glob("src/*.cc"))
Expand All @@ -38,7 +27,6 @@
include_dirs=["include"])]

setup(
version=version,
ext_modules=ext_modules,
cmdclass={'build_ext': build_ext},
)