Skip to content

Commit

Permalink
Merge pull request #128 from lsst/tickets/DM-35347
Browse files Browse the repository at this point in the history
DM-35347: Switch to pyproject.toml
  • Loading branch information
mwittgen committed Jul 12, 2022
2 parents d123ec7 + 97de4ab commit 54bc26c
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 74 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cache-dependency-path: "setup.cfg"

- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -100,7 +100,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 @@ -113,7 +113,7 @@ jobs:
- name: Build and create distribution
run: |
python -m build --sdist --wheel
python -m build --skip-dependency-check
- name: Upload
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
fetch-depth: 0

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

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint YAML Files

on:
push:
branches:
- main
pull_request:

jobs:
call-workflow:
uses: lsst/rubin_workflows/.github/workflows/yamllint.yaml@main
6 changes: 5 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
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
Expand All @@ -19,3 +19,7 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
19 changes: 19 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
extends: default

ignore: |
/tests/config/dbAuth/badDbAuth2.yaml
rules:
document-start: {present: false}
line-length:
max: 132
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true
ignore: |
/.github/workflows/lint.yaml
truthy:
# "on" as a key in workflows confuses things
ignore: |
/.github/workflows/
indentation:
indent-sequences: consistent
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include doc/lsst.utils/*.rst
66 changes: 65 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,57 @@
[build-system]
requires = ["lsst-versions"]
requires = ["setuptools", "lsst-versions >= 1.3.0"]
build-backend = "setuptools.build_meta"

[project]
name = "lsst-utils"
description = "Utility functions from Rubin Observatory Data Management for the Legacy Survey of Space and Time (LSST)."
license = {text = "BSD 3-Clause License"}
readme = "README.rst"
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",
]
keywords=["lsst"]
dependencies = [
"numpy >= 1.17",
"psutil >= 5.7",
"deprecated >= 1.2",
"pyyaml >= 5.1",
"astropy >= 5.0",
"threadpoolctl"
]
dynamic = ["version"]
[project.urls]
"Homepage" = "https://github.com/lsst/utils"
[project.optional-dependencies]
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.utils" = ["py.typed"]

[tool.setuptools.dynamic]
version = { attr = "lsst_versions.get_lsst_version" }

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

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

[tool.pytest.ini_options]
addopts = "--flake8"
flake8-ignore = ["E133", "E226", "E228", "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 = ["E133", "E226", "E228", "N802", "N803", "N806", "N812", "N815", "N816", "W503", "E203"]
67 changes: 0 additions & 67 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,72 +1,5 @@
[metadata]
name = lsst-utils
description = Utility functions from Rubin Observatory Data Management for the Legacy Survey of Space and Time (LSST).
author = Rubin Observatory Data Management
author_email = dm-admin@lists.lsst.org
url = https://github.com/lsst/utils
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.rst
long_description = file: README.rst
long_description_content_type = text/x-rst

keywords =
lsst

[options]
# zip_safe can't be used for mypy compatibility
zip_safe = False
package_dir=
=python
packages=find:
setup_requires =
setuptools >=46.0
install_requires =
numpy >= 1.17
psutil >= 5.7
deprecated >= 1.2
pyyaml >= 5.1
astropy >= 5.0
threadpoolctl
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.utils = py.typed

[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

# The ignore list for flake8 itself when run on the command line is distinct
# from the ignore list used by the pytest-flake8 plugin. This provides more
# control over testing but does require that the lists are kept in sync
# if there are later changes to the developer guide standard.
[flake8]
max-line-length = 110
max-doc-length = 79
ignore = E133, E226, E228, N802, N803, N806, N812, N815, N816, W503, E203
exclude = __init__.py

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

0 comments on commit 54bc26c

Please sign in to comment.