Skip to content

Commit

Permalink
Add infrastructure for PyPI.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktlim committed Mar 11, 2024
1 parent 9d7f369 commit d2ca4c7
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 1 deletion.
60 changes: 60 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build_and_test

on:
push:
branches:
- main
tags:
- "*"
pull_request:

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Build and install
run: |
python -m pip install --no-deps -v -e .
- name: Run tests
run: |
pytest -r a -v -n 3 --open-files --cov=tests --cov-report=xml --cov-report=term --cov-branch
- name: Upload coverage to codecov
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@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"

- 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 }}
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
[project]
name = "lsst-s3daemon"
description = "A daemon to maintain a connection pool for bursty S3 data transfers."
license = {text = "GPLv3+ License"}
readme = "README.md"
authors = [
{name="Rubin Observatory Data Management", email="dm-admin@lists.lsst.org"}
]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
keywords = ["lsst"]
dependencies = ["aiobotocore"]
dynamic = ["version"]
requires-python = ">=3.11.0"

[build-system]
requires = ["setuptools>=60", "setuptools-scm>=8.0"]

[tool.black]
line-length = 110
target-version = ["py311"]
Expand Down Expand Up @@ -54,3 +78,13 @@ max-doc-length = 79

[tool.ruff.pydocstyle]
convention = "numpy"

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

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

[tool.setuptools_scm]
version_file = "python/s3daemon/_version.py"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
aiobotocore
aiobotocore >= 2.12.0

0 comments on commit d2ca4c7

Please sign in to comment.