Skip to content

Commit 6f4a1de

Browse files
gcampclaudengc7293
authored
Convert project from pip to uv package manager (#40)
* Convert project from pip to uv package manager - Replace setup.py with modern pyproject.toml configuration - Update installation instructions in README.md and CLAUDE.md to use uv sync - Update GitHub Actions workflow to use uv instead of pip - Add uv.lock file for reproducible dependency resolution - Update deployment process to use uv build 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Fix PR review issues for uv conversion - Move pytest and flake8 to development dependencies in pyproject.toml - Update GitHub Actions to use uv sync --extra dev instead of adding flake8 during CI - Update installation instructions to include dev dependencies - Verified package discovery pattern matches actual codebase structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Add global flake8 configuration to exclude build directories - Create .flake8 config file to exclude .venv, build, dist, and *.egg-info - Set max-line-length to 127 and max-complexity to 10 - Simplify GitHub Actions workflow to use global config instead of command-line flags - Remove tool.flake8 from pyproject.toml (flake8 doesn't support this format) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update lock * Update .github/workflows/pull-request.yml Co-authored-by: David Bourgault <[email protected]> --------- Co-authored-by: Claude <[email protected]> Co-authored-by: David Bourgault <[email protected]>
1 parent 83b9b1b commit 6f4a1de

File tree

7 files changed

+772
-27
lines changed

7 files changed

+772
-27
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
exclude = .venv,build,dist,*.egg-info
3+
max-line-length = 127
4+
max-complexity = 10

.github/workflows/pull-request.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,18 @@ jobs:
2222
uses: actions/setup-python@v2
2323
with:
2424
python-version: ${{ matrix.python-version }}
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6
2527
- name: Install dependencies
2628
run: |
2729
sudo apt-get install libgeos-dev
28-
python -m pip install --upgrade pip
29-
python -m pip install flake8 pytest
30-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31-
if [ -f setup.py ]; then pip install -e .; fi
30+
uv sync --extra dev
3231
- name: Lint with flake8
3332
run: |
3433
# stop the build if there are Python syntax errors or undefined names
35-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
36-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
37-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
uv run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings
36+
uv run flake8 . --count --exit-zero --statistics
3837
- name: Test with pytest
3938
run: |
40-
python -m pytest .
39+
uv run -m pytest .

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Only `PURE_MICROTRANSIT` trips are converted to GOFS format.
3636

3737
### Installation
3838
```bash
39-
python -m pip install -e .
39+
uv sync --extra dev
4040
```
4141

4242
### Running Tests

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Tool to convert GTFS-Flex data to the GOFS-lite format
22

33
To install:
4-
* `python -m pip install -e .`
4+
* `uv sync --extra dev`
55

66
To run test:
7-
* `python -m pytest .`
7+
* `uv run python -m pytest .`
88

99
You can use `createTests.sh` to regenerate the test.
1010

1111
To deploy a new version, run:
1212
```
1313
rm -r dist/
14-
python setup.py sdist bdist_wheel
14+
uv build
1515
TWINE_USERNAME=transit TWINE_REPOSITORY_URL=https://pypi.transitapp.com:443 TWINE_PASSWORD=[PASSWORD] twine upload dist/*
1616
```
1717

pyproject.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "GTFS-flex-to-GOFS-lite"
7+
version = "0.4.1"
8+
description = "Convert GTFS Flex to GOFS lite"
9+
readme = "README.md"
10+
license = {text = "MIT"}
11+
authors = [
12+
{name = "Nicholas Paun"},
13+
{name = "Jonathan Milot"}
14+
]
15+
classifiers = [
16+
"License :: OSI Approved :: MIT License",
17+
"Programming Language :: Python :: 3",
18+
]
19+
requires-python = ">=3.8"
20+
dependencies = [
21+
"py-gtfs-loader @ git+https://github.com/transitapp/[email protected]",
22+
"shapely>=2.0.4"
23+
]
24+
25+
[project.optional-dependencies]
26+
dev = [
27+
"pytest",
28+
"flake8"
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/TransitApp/GTFS-flex-to-GOFS-lite"
33+
Repository = "https://github.com/TransitApp/GTFS-flex-to-GOFS-lite"
34+
35+
[tool.setuptools.packages.find]
36+
include = ["gtfs_flex_to_gofs_lite*"]
37+
38+
[project.scripts]
39+
gtfs-flex-to-gofs-lite = "gtfs_flex_to_gofs_lite.__main__:main"

setup.py

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

0 commit comments

Comments
 (0)