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-35327: Switch to pyproject.toml and add optional dependencies #24

Merged
merged 10 commits into from
Jun 27, 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
4 changes: 2 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: "pip"
Expand All @@ -107,7 +107,7 @@ jobs:

- name: Build and create distribution
run: |
python -m build --skip-dependency-check --sdist --wheel
python -m build --skip-dependency-check

- name: Upload
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v4.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-toml
- repo: https://github.com/psf/black
rev: 21.11b1
rev: 22.3.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -19,3 +20,7 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include doc/lsst.resources/*.rst
73 changes: 73 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,65 @@
requires = ["setuptools", "lsst-versions"]
build-backend = "setuptools.build_meta"

[project]
name = "lsst-resources"
description = "An abstraction layer for reading and writing from URI file resources."
license = {text = "BSD 3-Clause License"}
readme = "README.md"
authors = [
{name="Rubin Observatory Data Management", email="dm-admin@lists.lsst.org"},
]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"lsst-utils",
]
dynamic = ["version"]

[project.urls]
"Homepage" = "https://github.com/lsst/resources"

[project.optional-dependencies]
s3 = [
"boto3 >= 1.13",
"moto >= 1.3",
"backoff >= 1.10",
]
https = [
"requests >= 2.26.0",
"urllib3 >= 1.25.10",
"responses >= 0.12.0",
]
gs = [
"google-cloud-storage",
]
test = [
"pytest >= 3.2",
"flake8 >= 3.7.5",
"pytest-flake8 >= 1.0.4",
"pytest-openfiles >= 0.5.0",
]

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

[tool.setuptools]
zip-safe = true
license-files = ["COPYRIGHT", "LICENSE"]

[tool.setuptools.package-data]
"lsst.resources" = ["py.typed"]

[tool.setuptools.dynamic]
version = { attr = "lsst.resources.__version__" }

[tool.towncrier]
package = "lsst.resources"
package_dir = "python"
Expand Down Expand Up @@ -56,3 +115,17 @@ line_length = 110

[tool.lsst_versions]
write_to = "python/lsst/resources/version.py"

[tool.pytest.ini_options]
addopts = "--flake8"
flake8-ignore = ["N802", "N803", "N806", "N812", "N815", "N816", "W503", "E203"]

[tool.pydocstyle]
convention = "numpy"
# Our coding style does not require docstrings for magic methods (D105)
# Our docstyle documents __init__ at the class level (D107)
# We allow methods to inherit docstrings and this is not compatible with D102.
# Docstring at the very first line is not required
# D200, D205 and D400 all complain if the first sentence of the docstring does
# not fit on one line.
add-ignore = ["D107", "D105", "D102", "D100", "D200", "D205", "D400"]
1 change: 1 addition & 0 deletions python/lsst/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@

# Should only expose ResourcePath and its input type alias
from ._resourcePath import ResourcePath, ResourcePathExpression
from .version import *
54 changes: 0 additions & 54 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,59 +1,5 @@
[metadata]
name = lsst-resources
description = An abstraction layer for reading and writing from URI file resources.
author = Rubin Observatory Data Management
url = https://github.com/lsst/resources
author_email = dm-admin@lists.lsst.org
license = BSD 3-Clause License
classifiers =
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
readme = file: README.md
long_description = file: README.md
long_description_content_type = text/markdown

[options]
zip_safe = True
package_dir=
=python
packages=find:
setup_requires =
setuptools >=46.0
install_requires =
lsst-utils
tests_require =
pytest >= 3.2
flake8 >= 3.7.5
pytest-flake8 >= 1.0.4
pytest-openfiles >= 0.5.0

[options.packages.find]
where=python

[options.package_data]
lsst.resources = py.typed

[flake8]
max-line-length = 110
max-doc-length = 79
ignore = N802, N803, N806, N812, N815, N816, W503, E203
exclude = __init__.py

[tool:pytest]
addopts = --flake8
flake8-ignore = N802 N803 N806 N812 N815 N816 W503 E203

[pydocstyle]
convention = numpy
# Our coding style does not require docstrings for magic methods (D105)
# Our docstyle documents __init__ at the class level (D107)
# We allow methods to inherit docstrings and this is not compatible with D102.
# Docstring at the very first line is not required
# D200, D205 and D400 all complain if the first sentence of the docstring does
# not fit on one line.
add-ignore = D107, D105, D102, D100, D200, D205, D400