Skip to content

Commit c5daf3c

Browse files
authored
Merge pull request #115 from getslash/updates
Updates
2 parents 037ce5e + e3e0a66 commit c5daf3c

File tree

5 files changed

+77
-25
lines changed

5 files changed

+77
-25
lines changed

.github/workflows/main.yml

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,71 @@ on:
77
# manually triggered
88

99
jobs:
10-
build:
10+
test:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
14+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
15+
env:
16+
UV_PYTHON: ${{ matrix.python-version }}
1517

1618
steps:
17-
- uses: actions/checkout@v3
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
20-
with:
21-
python-version: ${{ matrix.python-version }}
19+
- name: Checkout the repository
20+
uses: actions/checkout@main
21+
- name: Install the default version of uv
22+
id: setup-uv
23+
uses: astral-sh/setup-uv@v3
24+
- name: Print the installed version
25+
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
26+
- name: Install Python ${{ matrix.python-version }}
27+
run: uv python install ${{ matrix.python-version }}
2228
- name: Install dependencies
23-
run: make env
29+
run: |
30+
uv venv
31+
uv pip install ".[testing]"
2432
- name: Lint with pylint
25-
run: make pylint
33+
run: .venv/bin/pylint --rcfile .pylintrc backslash tests
2634
- name: Test with pytest
27-
run: make test
28-
- name: Documentation
35+
run: .venv/bin/pytest tests --cov=backslash --cov-report=html
36+
37+
docs:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout the repository
41+
uses: actions/checkout@main
42+
- name: Install the default version of uv
43+
id: setup-uv
44+
uses: astral-sh/setup-uv@v3
45+
- name: Building docs
2946
run: make doc
47+
48+
publish:
49+
if: startsWith(github.ref, 'refs/tags/')
50+
needs: test
51+
runs-on: ubuntu-latest
52+
environment: release
53+
permissions:
54+
id-token: write
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 0
61+
62+
- name: Set up Python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: "3.11"
66+
67+
- name: Install hatch
68+
run: pip install hatch
69+
70+
- name: Build package
71+
run: hatch build
72+
73+
- name: Publish to PyPI
74+
uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
attestations: true
77+
skip-existing: true

Makefile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
default: test
22

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

66
pylint: env
7-
.env/bin/pylint --rcfile .pylintrc backslash tests
7+
.venv/bin/pylint --rcfile .pylintrc backslash tests
88

99
doc: env
10-
.env/bin/sphinx-build -a -W -E docs build/sphinx/html
10+
.venv/bin/sphinx-build -a -W -E docs build/sphinx/html
1111

12-
env: .env/.up-to-date
13-
14-
15-
.env/.up-to-date: Makefile pyproject.toml
16-
python3 -m venv .env
17-
.env/bin/pip install -e .[testing,doc]
18-
touch $@
12+
env:
13+
uv venv
14+
uv pip install -e .[testing,doc]
1915

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

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

10-
# Licence
10+
# License
1111

1212
BSD3
1313

docs/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Changelog
22
=========
33

4-
* :feature:`-` Support python versions 3.8 to 3.12
4+
* :feature:`-` Use UV
5+
* :feature:`-` Support python versions 3.8 to 3.13
56
* :feature:`-` Use pyproject.toml for project configuration
67
* :feature:`104` Drop support for python version < 3.6
78
* :release:`2.39.0 <03-07-2019>`

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ classifiers = [
1515
"Programming Language :: Python :: 3.10",
1616
"Programming Language :: Python :: 3.11",
1717
"Programming Language :: Python :: 3.12",
18+
"Programming Language :: Python :: 3.13",
1819
]
1920
dependencies = [
2021
"GitPython",
@@ -44,6 +45,10 @@ testing = [
4445
"pytest-cov>=2.6",
4546
"URLObject",
4647
"weber-utils",
48+
# Slash still using pkg_resources, installing setuptools as temporary workaround
49+
# so this repo can be installed with UV
50+
# Should be removed once a new version of slash will be released.
51+
"setuptools<81",
4752
]
4853
doc = ["alabaster", "releases", "Sphinx"]
4954

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

0 commit comments

Comments
 (0)