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/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.14"

- name: Build package
run: pip install build && python -m build
run: uv build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Testing
on:
push:
branches: ["*"]
branches: ["**"]
paths-ignore:
- 'docs/**'
- '*.md'
Expand All @@ -18,25 +18,25 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: pip install -e '.[dev]'
run: uv sync

- name: Run ruff check
run: ruff check .
run: uv run ruff check .

- name: Run ruff format check
run: ruff format --check .
run: uv run ruff format --check .

- name: Run unittests
run: coverage run && coverage report && coverage xml
- name: Run tests
run: uv run coverage run && uv run coverage report && uv run coverage xml

- name: Upload Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: build/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverage
.venv
*.egg-info
flatdict/_version.py
.python-version
14 changes: 7 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ FlatDict is a single-module Python library providing `FlatDict` and `FlatterDict
## Commands

```bash
# Setup dev environment (creates venv in .venv/, installs test deps)
./bootstrap
# Setup dev environment
uv sync

# Run tests
coverage run # runs unittest discover under coverage
coverage report # print coverage summary
uv run coverage run # runs pytest under coverage
uv run coverage report # print coverage summary

# Run a single test
.venv/bin/python -m unittest tests.FlatDictTests.test_method_name
uv run pytest tests.py::FlatDictTests::test_method_name

# Lint
ruff check .
ruff format --check .
uv run ruff check .
uv run ruff format --check .
```

## Architecture
Expand Down
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

## Setting up a development environment

Use of virtual environments will allow for isolated installation of testing requirements:
Install [uv](https://docs.astral.sh/uv/getting-started/installation/) and run:

```bash
./bootstrap
uv sync
```

## Running Tests

```bash
source .venv/bin/activate
ruff check .
ruff format --check .
coverage run && coverage report
uv run ruff check .
uv run ruff format --check .
uv run coverage run && uv run coverage report
```

`coverage xml` && `coverage html` are configured to output reports in the `build` directory.
Expand Down
5 changes: 0 additions & 5 deletions bootstrap

This file was deleted.

12 changes: 8 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]

[project.optional-dependencies]
[dependency-groups]
dev = [
"build",
"coverage",
"coverage[toml]",
"pytest",
"ruff",
]

Expand Down Expand Up @@ -80,9 +80,13 @@ flake8-quotes = {inline-quotes = "single"}
[tool.ruff.lint.isort]
known-first-party = ["flatdict"]

[tool.pytest.ini_options]
testpaths = ["."]
python_files = ["tests.py"]

[tool.coverage.run]
branch = true
command_line = "-m unittest discover"
command_line = "-m pytest"

[tool.coverage.report]
show_missing = true
Expand Down
304 changes: 304 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading