Skip to content
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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

on:
push:
branches: ["**"]
pull_request:

jobs:
tests:
name: Tests (py${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install deps
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install pytest

- name: Run tests
run: |
python -m pytest -q
45 changes: 26 additions & 19 deletions .github/workflows/python_publish.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
name: Upload Python Package
name: Publish to PyPI

on:
release:
types: [created]
types: [published]

permissions:
contents: read

jobs:
deploy:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v4

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

- name: Build dists
run: |
python -m pip install --upgrade pip
pip install build twine
python -m build
twine check dist/*

- name: Publish to PyPI
# Uses an API token stored as a GitHub Actions secret: PYPI_TOKEN
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
32 changes: 25 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
dist/
venv3/
# Python cache/artifacts
__pycache__/
*.py[cod]
*.so

# Virtual environments
venv/
venv*/
.venv/

# Test/cache
.pytest_cache/
.coverage
htmlcov/

# Packaging/build
build/
knockpy.egg-info/
*.pyc
knockpy_report/
knock_subdomains.egg-info/
.env
dist/
*.egg-info/

# Local environment/config
.env
.Rhistory

# Generated reports
*_report_*.html
Loading