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.

73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Run tests
run: uv run --python 3.14 --group dev pytest -q

- name: Build distributions
run: uv build

- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/

pypi-publish:
needs: build
runs-on: ubuntu-latest
# Configure a Trusted Publisher for this repo on PyPI, scoped to the
# "pypi" environment: https://docs.pypi.org/trusted-publishers/
environment: pypi
permissions:
id-token: write
steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

cloudsmith-publish:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
env:
CLOUDSMITH_REPO: "simoncrowedemo/python-query-filter"
steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Install and authenticate Cloudsmith CLI
uses: cloudsmith-io/cloudsmith-cli-action@v2
with:
# Org/namespace that owns the OIDC-enabled service account.
oidc-namespace: "simoncrowedemo"
# Service account slug configured for OIDC in Cloudsmith (Settings ->
# Services). Set as a repo variable so it isn't hardcoded.
oidc-service-slug: ${{ vars.CLOUDSMITH_SERVICE_SLUG }}

- name: Push to Cloudsmith
run: |
cloudsmith push python "$CLOUDSMITH_REPO" dist/*.tar.gz
cloudsmith push python "$CLOUDSMITH_REPO" dist/*.whl
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Run tests
run: uv run --python ${{ matrix.python-version }} --group dev pytest -q
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,21 +300,18 @@ It returns a predicate that's true if the queried object matches the regular exp

### Tests

If you want to run tests, you'll first need to install the package
from source and make it editable. Ensuring that you're in the root directory
of this repo, enter:
This project uses [uv](https://docs.astral.sh/uv/). From the root directory of
this repo, run the tests with:

```sh
pip install -e .
pip install -r requirements/development.txt
pytest
uv run --group dev pytest
```

To run tests with coverage:

```sh
coverage run --source "query_filter" -m pytest tests
coverage report
uv run --group dev coverage run --source "query_filter" -m pytest tests
uv run --group dev coverage report
```

### Feature ideas
Expand Down
51 changes: 51 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "query-filter"
version = "1.0.3"
description = "Python's filter function with composable queries."
readme = "README.md"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name = "Simon Crowe", email = "simon.r.crowe@pm.me" },
]
requires-python = ">=3.10"
dependencies = []
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

[project.urls]
Homepage = "https://github.com/simoncrowe/python-query-filter"
Repository = "https://github.com/simoncrowe/python-query-filter"

[tool.hatch.build.targets.wheel]
packages = ["query_filter"]

[dependency-groups]
dev = [
"pytest",
"coverage",
"bump-my-version",
]

[tool.bumpversion]
current_version = "1.0.3"
commit = true
tag = true
tag_name = "v{new_version}"

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
3 changes: 0 additions & 3 deletions requirements/development.txt

This file was deleted.

22 changes: 0 additions & 22 deletions setup.py

This file was deleted.

Loading
Loading