Skip to content

Commit

Permalink
Merge pull request #30 from lsst/tickets/DM-27354
Browse files Browse the repository at this point in the history
DM-27354: Enable pip installation using pyproject.toml / PEP 517
  • Loading branch information
timj committed Nov 5, 2020
2 parents fea843c + 45c70af commit fbfe500
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 38 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:
with:
python-version: 3.7

- name: Install dependencies
run: pip install -r requirements.txt

- name: Build and install
run: pip install -v .
run: |
python -m pip install --upgrade pip setuptools
python -m pip install .[yaml,test]
- name: Run tests
run: pytest -r a -v
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ tests/.cache/*
ups/*.cfgc
build/
.eggs/
*.egg-info/
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include LICENSE
include README.md
recursive-include include *.h
recursive-include src *.h
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools >= 46.6.0",
"wheel",
"pybind11 >= 2.5.0",
"numpy >= 1.18",
]
8 changes: 0 additions & 8 deletions requirements.txt

This file was deleted.

23 changes: 8 additions & 15 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
[metadata]
name = lsst_sphgeom
description = A Spherical Geometry Library
description = A spherical geometry library.
author = LSST Data Management
author_email = support@lsst.org
license = GPLv3
url = https://github.com/lsst/sphgeom
classifiers =
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Topic :: Scientific/Engineering :: Astronomy

[options]
zip_safe = False
package_dir=
=python
packages=find:
setup_requires =
setuptools >=46.0
wheel
pybind11 >=2.5.0
numpy >=1.17
setuptools_cpp >=0.0.1
install_requires =
numpy >=1.17
tests_require =
pytest >= 3.2
flake8 >= 3.7.5
pytest-flake8 >= 1.0.4
numpy >=1.18

[options.extras_require]
yaml = pyyaml>=5.1
test =
pytest >= 3.2
flake8 >= 3.7.5
pytest-flake8 >= 1.0.4

[options.packages.find]
where=python
where = python

[flake8]
max-line-length = 110
Expand Down
14 changes: 3 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@
interface.
"""

from setuptools import setup
from setuptools_cpp import ExtensionBuilder, Pybind11Extension
import os
import glob

# Importing this automatically enables parallelized builds
import numpy.distutils.ccompiler # noqa: F401
from setuptools import setup
from pybind11.setup_helpers import Pybind11Extension, build_ext

# Currently a fake version for testing
version = '0.0.1'
Expand All @@ -28,11 +27,6 @@
__version__ = '{version}'""", file=f)


# read the contents of the README file
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, "README.md"), encoding='utf-8') as f:
long_description = f.read()

# 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 @@ -45,8 +39,6 @@

setup(
version=version,
long_description=long_description,
ext_modules=ext_modules,
long_description_content_type="text/markdown",
cmdclass={'build_ext': ExtensionBuilder},
cmdclass={'build_ext': build_ext},
)

0 comments on commit fbfe500

Please sign in to comment.