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: 3 additions & 3 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ jobs:
linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
17 changes: 10 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ jobs:
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
strategy:
matrix:
python-version: ['3.11']
python-version:
- "3.11"
- "3.12"
- "3.13"
- "3.14"

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v6
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install libgirepository1.0-dev libgirepository-2.0-dev libcairo2-dev -y
pip install -r requirements.txt
pip install tox-gh-actions
- name: Test with tox
run: tox
- name: Run pytest
run: uv run pytest tests
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v4.4.0'
rev: 'v6.0.0'
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/psf/black
rev: '23.1.0'
rev: '26.3.1'
hooks:
- id: black
- repo: https://github.com/myint/autoflake
rev: 'v2.0.1'
rev: 'v2.3.3'
hooks:
- id: autoflake
args: ["--in-place", "--remove-unused-variables", "--remove-all-unused-imports"]
- repo: https://github.com/pycqa/isort
rev: '5.11.5'
rev: '8.0.1'
hooks:
- id: isort
name: isort (python)
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ the error message from nginx will be placed in `/data/web/nginx/nginx_error_outp
## Installation

```bash
python setup.py install
```

or

```bash
pip install -e git+https://github.com/ByteInternet/nginx_config_reloader#egg=nginx_config_reloader
uv sync
```

## Usage
Expand All @@ -32,8 +26,7 @@ pip install -e git+https://github.com/ByteInternet/nginx_config_reloader#egg=ngi
## Running tests

```bash
pip install -r requirements.txt
tox
uv run pytest tests
```

## Building debian packages
Expand Down
12 changes: 4 additions & 8 deletions _build_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@ git checkout $BRANCH
TEMPBRANCH="$BRANCH-build-$DIST-$VERSION"
git checkout -b $TEMPBRANCH

echo "Updating setup.py with version $VERSION"
perl -pi -e 's/version="[^"]*",/version=\"$ENV{"VERSION"}\",/g;' setup.py
echo "Updating project to version $VERSION"
git add pyproject.toml uv.lock

echo "Adding setup.py to git index"
git add setup.py

echo "Committing setup.py version update"
git commit setup.py -m "Update version in setup.py to $VERSION"
echo "Committing version update"
git commit pyproject.toml uv.lock -m "Update project version to $VERSION"

echo "Generating changelog changelog"
gbp dch --debian-tag="%(version)s" --new-version=$VERSION --debian-branch $TEMPBRANCH --release --commit


echo "Building package for $DIST"
mkdir -p $BUILDPATH
gbp buildpackage --git-pbuilder --git-export-dir=$BUILDPATH --git-dist=$DIST --git-arch=$ARCH \
Expand Down
11 changes: 4 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ if [ "$(git rev-parse --abbrev-ref HEAD)" != $BRANCH ]; then
fi;

export VERSION=$(date "+%Y%m%d.%H%M%S")
echo "Updating setup.py with version $VERSION"
perl -pi -e 's/version="[^"]*",/version=\"$ENV{"VERSION"}\",/g;' setup.py
echo "Updating project to version $VERSION"
git add pyproject.toml uv.lock

echo "Adding setup.py to git index"
git add setup.py

echo "Committing setup.py version update"
git commit setup.py -m "Update version in setup.py to $VERSION"
echo "Committing version update"
git commit pyproject.toml uv.lock -m "Update project version to $VERSION"

echo "Generating changelog changelog"
gbp dch --debian-tag="%(version)s" --new-version=$VERSION --debian-branch $BRANCH --release --commit
Expand Down
1 change: 1 addition & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/make -f
export PYBUILD_SYSTEM=pyproject

%:
dh $@ --with python3 --buildsystem=pybuild
Expand Down
8 changes: 4 additions & 4 deletions mark-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ deb_changelog_updated() {
mark_release() {
log "marking release $VERSION ..."

local setuppy="$ROOT_DIR/setup.py"
log "updating setup.py"
sed -i "s/version=\".*\",/version=\"$VERSION\",/" $setuppy
git add $setuppy
log "updating project version"
uv version "$VERSION"
git add pyproject.toml uv.lock

log "generating debian changelog"
gbp dch --debian-tag="%(version)s" --new-version=$VERSION --debian-branch=master
git add $CHANGELOG
Expand Down
31 changes: 31 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
[project]
name = "nginx-config-reloader"
version = "20260108.124844"
description = "nginx config file monitor and reloader"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"dasbus==1.7",
"pygobject<3.51",
"watchdog",
]

[tool.uv.sources]
watchdog = { git = "https://github.com/gorakhargosh/watchdog.git", rev = "f3e78cd4d9500d287bd11ec5d08a1f351601028d" }

[project.scripts]
nginx_config_reloader = "nginx_config_reloader:main"

[build-system]
requires = ["setuptools>=66", "wheel"]
build-backend = "setuptools.build_meta"

[dependency-groups]
dev = [
"black>=26.3.1",
"pre-commit>=3.2.0",
"pygobject-stubs>=2.16.0",
"pytest>=9.0.2",
"pytest-xdist>=3.8.0",
]

[tool.isort]
profile = "black" # Make isort compatible with black
11 changes: 0 additions & 11 deletions requirements.txt

This file was deleted.

17 changes: 0 additions & 17 deletions setup.py

This file was deleted.

14 changes: 0 additions & 14 deletions tox.ini

This file was deleted.

Loading
Loading