Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- main

jobs:
docs:
deploy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
uv publish -t "$PYPI_TOKEN" --managed-python
uv publish -t "$PYPI_TOKEN" --managed-python --check-url https://pypi.org/simple
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
repos:
- repo: local
hooks:
- id: testing
name: testing
description: This hook tests the app
entry: ./bin/test.sh
language: python
types: [text]
- id: bumping-version
name: Bumping version
description: This hook bumps the version of the app
entry: uv run ./bin/bump-version.py
language: python
types: [text]

default_stages: [pre-push]
41 changes: 41 additions & 0 deletions bin/bump-version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env python3
import tomllib
import subprocess

import tomli_w


def bump_version(version: str) -> str:
splitted_version = version.split(".")
bumped_version = int(splitted_version[-1]) + 1
splitted_version[-1] = str(bumped_version)
return ".".join(splitted_version)


def main() -> None:
with open("uv.lock", "rb") as fd:
data = tomllib.load(fd)

package = next(p for p in data["package"] if p["name"] == "edit-python-pe")

package["version"] = bump_version(package["version"])

with open("pyproject.toml", "rb") as fd:
data = tomllib.load(fd)

data["project"]["version"] = package["version"]

with open("pyproject.toml", "wb") as fd:
tomli_w.dump(data, fd)

subprocess.run(["git", "add", "pyproject.toml"])

with open("uv.lock", "wb") as fd:
tomli_w.dump(data, fd)

subprocess.run(["git", "add", "uv.lock"])
subprocess.run(["git", "commit", "-m", "Bump version"])


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion bin/test.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
uv run pytest --cov=src --cov-report=term-missing
uv run pytest --cov=src --cov-report=term-missing --cov-reset
38 changes: 18 additions & 20 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
[project]
name = "edit-python-pe"
version = "0.2.1"
version = "0.2.3"
description = "Allows member and project profile editing onto python.pe git repository"
readme = "README.md"
license = { file = "LICENSE" }
authors = [
{ name = "Jean-Pierre Chauvel", email = "jean.p.chauvel@gmail.com" }
{ name = "Jean-Pierre Chauvel", email = "jean.p.chauvel@gmail.com" },
]
requires-python = ">=3.13"
classifiers = [
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 4 - Beta",

# Indicate who your project is intended for
"Intended Audience :: Developers",
"Topic :: Documentation :: Sphinx",

# Specify the Python versions you support here.
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Documentation :: Sphinx",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
]
module = "edit_python_pe"
dependencies = [
Expand All @@ -33,6 +24,9 @@ dependencies = [
"babel==2.17.0",
]

[project.license]
file = "LICENSE"

[project.urls]
Homepage = "http://github.com/pythonpe/edit-python.pe"
Documentation = "https://github.com/pythonpe/edit-python.pe/blob/main/README.md"
Expand All @@ -43,22 +37,26 @@ Issues = "https://github.com/pythonpe/edit-python.pe/issues"
edit-python-pe = "edit_python_pe.main:main"

[build-system]
requires = ["hatchling"]
requires = [
"hatchling",
]
build-backend = "hatchling.build"

[tool.hatch.version]
path = "src/edit_python_pe/__about__.py"

[tool.black]
line-length = 79

[dependency-groups]
dev = [
"black>=25.1.0",
"deep-translator>=1.11.4",
"isort>=6.0.1",
"polib>=1.2.0",
"pre-commit>=4.3.0",
"pytest>=8.4.1",
"pytest-cov>=6.2.1",
"textual-dev==1.7.0",
"tomli-w>=1.2.0",
]

[tool.black]
line-length = 79
Loading