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
6 changes: 0 additions & 6 deletions .bumpversion.cfg

This file was deleted.

81 changes: 34 additions & 47 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,32 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]
python-version: ['3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4

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

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install pytest coverage coveralls
pip install -e ".[dev]"

- name: Run tests with coverage
run: |
coverage run --source=urbackup -m pytest tests/
coverage run -m pytest tests/
coverage report -m

- name: Coveralls
Expand All @@ -53,71 +52,59 @@ jobs:
build:
needs: test
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
if: github.event_name == 'release'

steps:
- uses: actions/checkout@v4

- name: Bump patch version
if: github.ref == 'refs/heads/master'

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

- name: Update version from tag
run: |
pip install bump2version
bump2version patch
env:
GIT_COMMITTER_NAME: github-actions[bot]
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com
GIT_AUTHOR_NAME: github-actions[bot]
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com
VERSION="${GITHUB_REF_NAME#v}"
sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml

- name: Build package
run: |
pip install setuptools wheel
python setup.py sdist bdist_wheel
pip install build
python -m build

- name: Upload build artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/*

publish-testpypi:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Publish to TestPyPI
run: |
pip install twine
twine upload --repository testpypi dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
password: ${{ secrets.TESTPYPI_API_TOKEN }}

deploy:
needs: publish-testpypi
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: Publish to PyPI
run: |
pip install twine
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
20 changes: 11 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
python_urbackup.egg-info/*
dist/python-urbackup-*.zip
urbackup/__pycache__/*
test.py
*.egg-info/
dist/
build/
*.pyc
__pycache__
env
build
dist
site
__pycache__/
.pytest_cache/
.coverage
htmlcov/
env/
.venv/
site/
test.py
13 changes: 4 additions & 9 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# Read the Docs configuration file for MkDocs projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the Python version
build:
os: ubuntu-22.04
tools:
python: "3.12"

# Build documentation in the "docs/" directory with MkDocs
mkdocs:
configuration: mkdocs.yml

# Optionally build your docs in additional formats such as HTML
formats:
- htmlzip

# Declare the Python requirements required to build your documentation
python:
install:
- requirements: requirements.txt
- method: pip
path: .
extra_requirements:
- dev
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

Loading
Loading