Skip to content

Commit 89566cd

Browse files
committed
Modernize project to use pyproject.toml
1 parent 6e46eb6 commit 89566cd

File tree

6 files changed

+19
-23
lines changed

6 files changed

+19
-23
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ repos:
2525
- id: check-yaml
2626
- id: end-of-file-fixer
2727
- id: forbid-submodules
28-
- id: requirements-txt-fixer
2928
- id: trailing-whitespace
3029
- repo: https://github.com/pre-commit/mirrors-clang-format
3130
rev: v18.1.2

DEVELOPMENT.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ install a virtual environment with pre-commmit set up, and then use precommit to
88
install git hooks it to your local repository:
99

1010
```bash
11-
python3 -m venv .venv # Create a Python virtual env
12-
source ./.venv/bin/activate # Activate the virtual env for bash by source.
13-
pip install -r requirements.txt # Install latest requirements including pre-commit
14-
pre-commit install # Use pre-commit to install git hooks into the working repository.
11+
uv sync # Install dependencies
12+
uv run pre-commit install # Use pre-commit to install git hooks into the working repository.
1513
```
1614

1715
pre-commit is configured with .pre-commit-config.yaml which contains some

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,24 @@ simple Python model of a C++ translation unit.
1919
Currently the environment variable `PY_CPPMODEL_LIBCLANG_PATH` must be defined
2020
to specify where libclang can be found. This may be fixed in the future.
2121

22-
## Testing
22+
## Development
23+
24+
To set up the development environment, execute the following commands:
25+
26+
```sh
27+
uv sync
28+
```
2329

2430
To run the tests, run:
2531

2632
```sh
27-
python3 -m venv .venv # Create a Python virtual env.
28-
source ./.venv/bin/activate # Activate the virtual env for bash by source.
33+
uv run python -m unittest discover .
34+
```
35+
36+
To run type checking:
2937

30-
mypy *.py --check-untyped-defs # Run mypy to check type hints.
31-
unittest discover . # Run tests.
38+
```sh
39+
uv run mypy *.py --check-untyped-defs
3240
```
3341

3442
## Attribution

requirements.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

test.macos.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/usr/bin/env bash
22

3-
# Virtual environment setup
4-
python3 -m venv .venv # Create a Python virtual env
5-
source ./.venv/bin/activate # Activate the virtual env for bash by source.
6-
python3 -m pip install -r requirements.txt # Install latest requirements.
3+
# Install dependencies
4+
uv sync
75

86
# Type checks
9-
python3 -m mypy *.py --check-untyped-defs # Run mypy to check type hints
7+
uv run mypy *.py --check-untyped-defs # Run mypy to check type hints
108

119
# Unit tests
1210
PY_CPPMODEL_LIBCLANG_PATH=/Library/Developer/CommandLineTools/usr/lib/libclang.dylib \
13-
python3 -m unittest discover --verbose . # Run tests
11+
uv run python3 -m unittest discover --verbose . # Run tests

test_py_cppmodel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import py_cppmodel
44
import unittest
55

6-
from ctypes.util import find_library
7-
86
LIBCLANG_PATH = os.environ.get("PY_CPPMODEL_LIBCLANG_PATH")
97
if not LIBCLANG_PATH:
108
raise RuntimeError("PY_CPPMODEL_LIBCLANG_PATH is unset")

0 commit comments

Comments
 (0)