8000 Switch from pipenv to uv and add pre-commit with ruff formatting by jeancochrane · Pull Request #18 · ccao-data/extract-permits · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Switch from pipenv to uv and add pre-commit with ruff formatting #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 15, 2025
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
21 changes: 12 additions & 9 deletions .github/workflows/extract-chicago-permits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ env:
WORKING_DIR: chicago
S3_BUCKET: ccao-data-public-us-east-1
S3_PREFIX: permits/chicago
UV_SYSTEM_PYTHON: 1
PYTHONUNBUFFERED: "1"

jobs:
extract-chicago-permits:
Expand All @@ -46,18 +48,19 @@ jobs:
- name: Checkout repo code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: "3.10"
cache: pipenv
enable-cache: true
cache-dependency-glob: ${{ env.WORKING_DIR }}/uv.lock

- name: Install pipenv
run: pip install pipenv
shell: bash
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version-file: ${{ env.WORKING_DIR }}/.python-version

- name: Install Python requirements
run: pipenv install
run: uv pip install .
shell: bash
working-directory: ${{ env.WORKING_DIR }}

Expand All @@ -69,7 +72,7 @@ jobs:

- name: Extract permits
run: |
pipenv run python3 permit_cleaning.py \
python3 permit_cleaning.py \
'${{ inputs.start_date }}' \
'${{ inputs.end_date }}' \
'${{ inputs.deduplicate }}'
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
on:
pull_request:
push:
branches: [main, master]

name: pre-commit

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run pre-commit checks
uses: ccao-data/actions/pre-commit@main
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,5 @@ cython_debug/

# Ignore generated data
chicago/files_for_*
chicago/chicago_pin_universe.csv
chicago/chicago_pin_universe*.csv

11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.5
hooks:
# Python linter. Ruff recommends running this before the formatter to
# avoid conflicts when using the --fix flag
- id: ruff
args:
- --fix
# Formatter
- id: ruff-format
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# extract-permits

Scripts and workflows for permit data extraction.

The code in this repo is under active development and is not yet being used
in production.
Empty file removed chicago/.gitkeep
Empty file.
1 change: 1 addition & 0 deletions chicago/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
16 changes: 0 additions & 16 deletions chicago/Pipfile

This file was deleted.

327 changes: 0 additions & 327 deletions chicago/Pipfile.lock

This file was deleted.

Loading
Loading
0