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

build: Use hatchling as build backend #145

Merged
merged 10 commits into from
Jun 16, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
11 changes: 2 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,10 @@ jobs:
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install uv
uv pip install --system --upgrade pip setuptools wheel
uv pip install --system --upgrade '.[develop]'
uv pip list --system

- name: Lint with flake8
run: |
python -m flake8 .
pipx run flake8 .

- name: Lint with Black
run: |
black --check --diff --verbose .
pipx run black --check --diff --verbose .
8 changes: 2 additions & 6 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,13 @@ jobs:
with:
python-version: '3.x'

- name: Install build, check-manifest, and twine
- name: Install build and twine
run: |
python -m pip install uv
uv pip install --system --upgrade pip setuptools wheel
uv pip install --system build check-manifest twine
uv pip install --system build twine
uv pip list --system

- name: Check MANIFEST
run: |
check-manifest

- name: Build a sdist and a wheel
run: |
python -m build .
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ htmlcov
dist
.coverage.*
docs/_build

# version file
src/recastatlas/_version.py
12 changes: 0 additions & 12 deletions MANIFEST.in

This file was deleted.

6 changes: 4 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ FROM docker:20.10.5
RUN apk add --update && \
apk add --no-cache \
build-base \
git \
gcc \
make \
automake \
Expand Down Expand Up @@ -36,14 +37,15 @@ RUN apk add --update && \
font-bitstream-type1 \
ttf-freefont

WORKDIR /code
COPY . /code

# Set PATH to pickup virtual environment by default
ENV PATH=/usr/local/venv/bin:"${PATH}"
RUN python3 -m venv /usr/local/venv && \
. /usr/local/venv/bin/activate && \
cd /code && \
python -m pip --no-cache-dir install --upgrade uv && \
uv --no-cache pip install --upgrade pip setuptools wheel && \
uv --no-cache pip install --upgrade pip wheel && \
uv --no-cache pip install \
lxml \
cryptography \
Expand Down
118 changes: 103 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,106 @@
[build-system]
requires = [
"hatchling>=1.13.0",
"hatch-vcs>=0.3.0",
]
build-backend = "hatchling.build"

[project]
name = "recast_atlas"
dynamic = ["version"]
description = "RECAST for ATLAS at the LHC"
readme = "README.md"
license = { text = "Apache-2.0" } # SPDX short identifier
requires-python = ">=3.8"
authors = [
{ name = "Lukas Heinrich", email = "[email protected]" },
{ name = "Matthew Feickert", email = "[email protected]" },
]
maintainers = [ { name = "Matthew Feickert", email = "[email protected]" } ]
keywords = [
"physics",
"RECAST",
"ATLAS",
"reinterpretation",
"analysis reuse",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
]

# TODO: Empirically evaluate lower bounds
dependencies = [
"click>=7.0", # for console scripts
"jsonschema>=3.0.0",
"pyyaml>=5.1", # for parsing CLI options
"yadage-schemas>=0.10.7", # c.f. https://github.com/yadage/yadage-schemas/issues/35
"importlib-resources>=5.10; python_version < '3.9'", # for accessing package filepaths
]

[project.scripts]
recast = "recastatlas.cli:recastatlas"

[project.urls]
Documentation = "https://github.com/recast-hep/recast-atlas"
Homepage = "https://github.com/recast-hep/recast-atlas"
"Issue Tracker" = "https://github.com/recast-hep/recast-atlas/issues"
"Releases" = "https://github.com/recast-hep/recast-atlas/releases"
"Source Code" = "https://github.com/recast-hep/recast-atlas"

[project.optional-dependencies]
local = [
"pydotplus==2.0.2",
"adage>=0.10.1",
"packtivity>=0.14.23",
"yadage>=0.20.1", # yadage[viz] breaks so install following manually
"pydot", # from yadage[viz] extra
"pygraphviz" # from yadage[viz] extra
]
kubernetes = ["kubernetes==9.0.0"]
reana = ["reana-client>=0.8.0"]
all = ["recast-atlas[local,kubernetes,reana]"]

# Developer extras
develop = [
"pytest>=7.0.0",
"flake8>=3.9.0",
"black",
"pre-commit",
]

[tool.hatch.version]
source = "vcs"

[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.hatch.build.hooks.vcs]
version-file = "src/recastatlas/_version.py"

[tool.hatch.build.targets.sdist]
# hatchling always includes:
# pyproject.toml, .gitignore, any README, any LICENSE, AUTHORS
only-include = [
"/src",
"/tests",
"/CITATION.cff"
]

[tool.hatch.build.targets.wheel]
packages = ["src/recastatlas"]

[tool.black]
line-length = 88
skip-string-normalization = true
Expand All @@ -9,18 +112,3 @@ exclude = '''
| build
)/
'''

[tool.check-manifest]
ignore = [
'docs*',
'validation*',
'examples*',
'tests*',
'docker*',
'binder*',
'.*',
'pyproject.toml',
'pytest.ini',
'CODE_OF_CONDUCT.md',
'CONTRIBUTING.md',
]
51 changes: 0 additions & 51 deletions setup.cfg

This file was deleted.

17 changes: 0 additions & 17 deletions setup.py

This file was deleted.

Loading