Skip to content
Draft
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/hubcap-scheduler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:

- name: Install dependencies with uv
run: |
uv pip install --system -r requirements.txt
uv sync
# Install dev requirements for PR testing
if [ "${{ github.event_name }}" = "pull_request" ]; then
uv pip install --system -r requirements-dev.txt
uv sync --extra test
fi

- name: Install dbt fusion
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: Run hubcap
run: |
echo "Starting hubcap execution..."
uv run python hubcap.py 2>&1 | tee hubcap.log
uv run hubcap 2>&1 | tee hubcap.log

- name: Check execution results
if: always()
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ jobs:

- name: Install python dependencies with uv
run: |
uv pip install --system pre-commit
uv tool install pre-commit --with pre-commit-uv
pre-commit --version
uv pip install --system -r requirements.txt
uv pip install --system -r requirements-dev.txt
uv sync --extra test
- name: Run pre-commit hooks
run: pre-commit run --all-files --show-diff-on-failure

Expand Down Expand Up @@ -67,8 +66,7 @@ jobs:

- name: Install dependencies with uv
run: |
uv pip install --system -r requirements.txt
uv pip install --system -r requirements-dev.txt
uv sync --extra test

- name: Install dbt fusion (for integration tests)
run: |
Expand Down
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,26 @@ __pycache__/
config.json
hub.current.json
logs/

# Python-generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info

# Virtual environments
.venv
.nox
venv

# IDE files
.vscode/launch.json
.vscode/settings.json

# special files
config_resources.csv
project2/*

.DS_Store
34 changes: 16 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

## Virtual environment

This package is managed with `uv`. You can run it using `uv run hubcap` in the project root.

### Install dependencies
Instructions for POSIX bash/zsh (see [here](https://docs.python.org/3/library/venv.html) for syntax for other shells):
To run tests and develop locally, install the additional dev dependencies:
```shell
python3 -m venv env
source env/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt -r requirements-dev.txt
source env/bin/activate
pre-commit install
uv tool install pre-commit --with pre-commit-uv
pre-commit --version
uv sync --extra test
```

## Setup
Expand Down Expand Up @@ -45,7 +44,12 @@ export CONFIG=$(<config.json)

Run:
```shell
python3 hubcap.py
uv run hubcap
```

Run pre-commit hooks manually:
```shell
pre-commit run --all-files --show-diff-on-failure
```

### GitHub Actions testing
Expand All @@ -68,13 +72,13 @@ See [GITHUB_ACTIONS_SETUP.md](GITHUB_ACTIONS_SETUP.md) for setup instructions.

Run:
```shell
python3 hubcap.py
uv run hubcap
```

## Testing locally

```shell
python -m pytest
uv run pytest
```

Or just:
Expand All @@ -95,12 +99,6 @@ For Apple M1 Mac users, might need to do this:
act --container-architecture linux/amd64
```

## Generate requirements.txt

Put any first degree dependencies within `requirements.in`, then run:

```shell
pip-compile
```
## Adding dependencies

It will generate a new version of `requirements.txt` with each transitive dependency pinned to a specific version.
Add all dependencies with uv: `uv add <package-name>`
2 changes: 1 addition & 1 deletion hub.json
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@
"YukiTechnologies": [
"yuki-snowflake-dbt-tags"
],
"datooine": [
"datooine": [
"dbt-buckets"
]
}
8 changes: 6 additions & 2 deletions hubcap.py → hubcap/hubcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
from hubcap.records import IndividualPullRequests, ConsolididatedPullRequest


def app():
exit_code = main()
sys.exit(exit_code)


def main():
try:
# ==
Expand Down Expand Up @@ -191,5 +196,4 @@ def main():


if __name__ == "__main__":
exit_code = main()
sys.exit(exit_code)
app()
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[project]
name = "hubcap"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"certifi==2022.12.7",
"charset-normalizer==2.1.1",
"gitdb==4.0.9",
"gitpython==3.1.30",
"idna==3.4",
"pyyaml==6.0",
"requests==2.28.1",
"semver==2.13.0",
"smmap==5.0.0",
"urllib3==1.26.12",
]

[project.optional-dependencies]
test = [
"black==22.6.0",
"pip-tools>=7.5.2",
"pre-commit>=4.5.0",
"pytest>=9.0.1",
"tox>=4.32.0",
]

[project.scripts]
hubcap = "hubcap.hubcap:app"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements.in

This file was deleted.

26 changes: 0 additions & 26 deletions requirements.txt

This file was deleted.

Loading
Loading