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
70 changes: 59 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,71 @@ on:
# manually triggered

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
env:
UV_PYTHON: ${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout the repository
uses: actions/checkout@main
- name: Install the default version of uv
id: setup-uv
uses: astral-sh/setup-uv@v3
- name: Print the installed version
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
- name: Install Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: make env
run: |
uv venv
uv pip install ".[testing]"
- name: Lint with pylint
run: make pylint
run: .venv/bin/pylint --rcfile .pylintrc backslash tests
- name: Test with pytest
run: make test
- name: Documentation
run: .venv/bin/pytest tests --cov=backslash --cov-report=html

docs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@main
- name: Install the default version of uv
id: setup-uv
uses: astral-sh/setup-uv@v3
- name: Building docs
run: make doc

publish:
if: startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Install hatch
run: pip install hatch

- name: Build package
run: hatch build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
attestations: true
skip-existing: true
16 changes: 6 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
default: test

test: env
.env/bin/pytest -x tests --cov=backslash --cov-report=html
.venv/bin/pytest -x tests --cov=backslash --cov-report=html

pylint: env
.env/bin/pylint --rcfile .pylintrc backslash tests
.venv/bin/pylint --rcfile .pylintrc backslash tests

doc: env
.env/bin/sphinx-build -a -W -E docs build/sphinx/html
.venv/bin/sphinx-build -a -W -E docs build/sphinx/html

env: .env/.up-to-date


.env/.up-to-date: Makefile pyproject.toml
python3 -m venv .env
.env/bin/pip install -e .[testing,doc]
touch $@
env:
uv venv
uv pip install -e .[testing,doc]

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

| | |
|-----------------------|-----------------------------------------------------------------------------------------|
| Build Status | ![Build Status](https://github.com/getslash/backslash-python/actions/workflows/main.yml/badge.svg?branch=develop) |
| Build Status | ![Build Status](https://github.com/getslash/backslash-python/actions/workflows/main.yml/badge.svg?branch=master) |
| Supported Versions | ![Supported Versions](https://img.shields.io/pypi/pyversions/backslash.svg) |
| Latest Version | ![Latest Version](https://img.shields.io/pypi/v/backslash.svg) |

# Licence
# License

BSD3

3 changes: 2 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Changelog
=========

* :feature:`-` Support python versions 3.8 to 3.12
* :feature:`-` Use UV
* :feature:`-` Support python versions 3.8 to 3.13
* :feature:`-` Use pyproject.toml for project configuration
* :feature:`104` Drop support for python version < 3.6
* :release:`2.39.0 <03-07-2019>`
Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"GitPython",
Expand Down Expand Up @@ -44,6 +45,10 @@ testing = [
"pytest-cov>=2.6",
"URLObject",
"weber-utils",
# Slash still using pkg_resources, installing setuptools as temporary workaround
# so this repo can be installed with UV
# Should be removed once a new version of slash will be released.
"setuptools<81",
]
doc = ["alabaster", "releases", "Sphinx"]

Expand All @@ -53,4 +58,6 @@ source = "vcs"
[tool.pytest]
testpaths = "tests"
timeout_method = "signal"
addopts = "-ra -W error::DeprecationWarning"
# Current slash version uses pkg_resources, deprecated module, which emits warnings.
# This option (of consider warnings as errors) should be comment out, until a new slash version will be released.
# addopts = "-ra -W error::DeprecationWarning"