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-35347: Switch to pyproject.toml #6

Merged
merged 1 commit into from
Jul 14, 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
40 changes: 37 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ on:
jobs:
build_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10"]

steps:
- uses: actions/checkout@v3
with:
# Need to clone everything to determine version from git.
fetch-depth: 0
cache: "pip"
cache-dependency-path: "setup.cfg"

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

- name: Update pip/wheel infrastructure
run: |
Expand Down Expand Up @@ -52,3 +54,35 @@ jobs:
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml

pypi:

runs-on: ubuntu-latest
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v3
with:
# Need to clone everything to embed the version.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.10

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel build

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

- name: Upload
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_UPLOADS }}
13 changes: 13 additions & 0 deletions .github/workflows/docstyle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Run docstyle

on:
push:
branches:
- main
pull_request:

jobs:
call-workflow:
uses: lsst/rubin_workflows/.github/workflows/docstyle.yaml@main
with:
args: "python/lsst/ctrl/bps/htcondir"
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
args:
Expand All @@ -21,3 +21,7 @@ repos:
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
hooks:
- id: flake8
16 changes: 16 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
extends: default

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.ctrl.bps.htcondor/*.rst
66 changes: 63 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
[build-system]
requires = ["lsst-versions"]
requires = ["setuptools", "lsst-versions >= 1.3.0"]
build-backend = "setuptools.build_meta"

[project]
name = "lsst-ctrl-bps-htcondor"
description = "HTCondor plugin for lsst-ctrl-bps."
license = {text = "GPLv3+ License"}
readme = "README.rst"
authors = [
{name="Rubin Observatory Data Management", email="dm-admin@lists.lsst.org"},
]
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.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Astronomy",
]
keywords = ["lsst"]
dependencies = [
"htcondor >= 8.8",
"lsst-ctrl-bps",
"lsst-daf-butler",
"lsst-utils"
]
dynamic = ["version"]

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

[project.optional-dependencies]
mwittgen marked this conversation as resolved.
Show resolved Hide resolved
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.dynamic]
version = { attr = "lsst_versions.get_lsst_version" }

[tool.towncrier]
package = "lsst.ctrl.bps.htcondor"
package_dir = "python"
filename = "doc/lsst.ctrl.bps/CHANGES.rst"
filename = "doc/lsst.ctrl.bps.htcondor/CHANGES.rst"
directory = "doc/changes"
title_format = "ctrl_bps {version} {project_date}"
issue_format = "`{issue} <https://jira.lsstcorp.org/browse/{issue}>`_"


[[tool.towncrier.type]]
directory = "feature"
name = "New Features"
Expand Down Expand Up @@ -51,3 +97,17 @@ line_length = 110

[tool.lsst_versions]
write_to = "python/lsst/ctrl/bps/htcondor/version.py"

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

[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"]
38 changes: 0 additions & 38 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
[metadata]
name = lsst-ctrl-bps-htcondor
description = HTCondor plugin for ctrl_bps
author = Rubin Observatory Data Management
url = https://github.com/lsst/ctrl_bps
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.8
Topic :: Scientific/Engineering :: Astronomy

[options]
zip_safe = True
package_dir=
=python
packages=find:
setup_requires =
setuptools >=46.0
install_requires =
htcondor >= 8.8
lsst-ctrl-bps @ git+https://github.com/lsst/ctrl_bps.git
lsst-daf-butler
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

[flake8]
max-line-length = 110
max-doc-length = 79
Expand All @@ -42,7 +8,3 @@ exclude =
**/*/__init__.py,
**/*/version.py,
tests/.tests

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