Skip to content
Open
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
51 changes: 51 additions & 0 deletions .github/workflows/validate-packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Validate packaging metadata

on:
pull_request:
push:

jobs:
metadata:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

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

- name: Build distributions
run: python -m build

- name: Dump METADATA
run: |
echo '--- METADATA ---'
unzip -p dist/*.whl '*/METADATA' > METADATA || unzip -p dist/*.whl '*-info/METADATA' > METADATA
cat METADATA

- name: Validate license
run: |
EXPECTED_LICENSE='Apache-2.0'
if grep -q "^License: ${EXPECTED_LICENSE}$" METADATA; then
echo "License matches: ${EXPECTED_LICENSE}"
elif grep -q "^Classifier: License :: OSI Approved :: Apache Software License$" METADATA; then
echo "License classifier present"
else
echo "ERROR: license metadata does not match ${EXPECTED_LICENSE}"; exit 1
fi

- name: Validate Requires-Python
run: |
EXPECTED_PY='>=3.8'
if grep -q "^Requires-Python: ${EXPECTED_PY}$" METADATA; then
echo "Requires-Python matches: ${EXPECTED_PY}"
else
echo "ERROR: Requires-Python missing or not ${EXPECTED_PY}"; exit 1
fi
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ For a detailed description and installation instructions, please check out this
https://github.com/HSF/harvester/wiki

----------

Packaging note
--------------

This project uses `pyproject.toml` (Hatch/hatchling) as the canonical source of packaging
metadata (license, build-backend, dependencies). Keep `pyproject.toml` in sync when making
packaging changes; `setup.py` is maintained for legacy compatibility and should mirror
the same license and supported Python versions.
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ authors = [
{ name = "PanDA Team", email = "panda-support@cern.ch" },
]

# Declared Python requirement and PyPI classifiers for explicit metadata
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"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",
"Operating System :: OS Independent",
]

dependencies = [
'requests',
'python-daemon',
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@
version=release_version,
description="Harvester Package",
long_description="""This package contains Harvester components""",
license="GPL",
# Packaging metadata is canonicalised in pyproject.toml (PEP 621/517).
# Keep this file compatible with that metadata.
license="Apache-2.0",
author="Panda Team",
author_email="atlas-adc-panda@cern.ch",
url="https://github.com/PanDAWMS/panda-harvester/wiki",
python_requires=">=2.7",
# The project is maintained for modern Python; declare supported versions here
# and keep in sync with `pyproject.toml` (preferred source of truth).
python_requires=">=3.8",
packages=find_packages(),
install_requires=[
"requests",
Expand Down