Skip to content
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

UV package management and Snowflake logging extras #35

Merged
merged 12 commits into from
Sep 25, 2024
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
31 changes: 17 additions & 14 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,28 @@ jobs:
build-and-publish-docs:
name: Build and publish docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: requirements*.txt

- name: Install dependencies
python-version: 3.12

# Install uv package manager
- name: Install uv
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt

pip install uv

- name: Install dependencies
run: |
uv sync --frozen --all-extras

- name: Build docs
run: mkdocs build
run: uv run mkdocs build

- name: Publish docs
uses: JamesIves/[email protected]
with:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ jobs:
cache: pip
cache-dependency-path: requirements*.txt

- name: Install packages
# Install uv package manager
- name: Install uv
run: |
python -m pip install --upgrade pip build
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
python -m pip install --upgrade pip
pip install uv

- name: Install dependencies
run: |
uv sync --frozen --all-extras

- name: Build a binary wheel and a source tarball
run: |
python -m build --sdist --wheel --outdir dist/
uv run python -m build --sdist --wheel --outdir dist/

- name: Publish build artifacts
uses: actions/upload-artifact@v3
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
pull_request:
paths:
- '.github/workflows/pytest.yml'
- 'requirements.txt'
- 'requirements-dev.txt'
- 'pyproject.toml'
- 'uv.lock'
- 'src/**'
- 'tests/**'

Expand All @@ -27,15 +27,17 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache-dependency-path: requirements*.txt
cache: pip

- name: Install dependencies

# Install uv package manager
- name: Install uv
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r requirements-dev.txt
pip install uv

- name: Install dependencies
run: |
uv sync --frozen --all-extras

- name: Run tests
run: |
python -m pytest tests/ -vv
uv run pytest tests/ -vv
6 changes: 0 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@ repos:
hooks:
- id: black
language_version: python3
- repo: https://github.com/econchick/interrogate
rev: 1.7.0
hooks:
- id: interrogate
args: [-vv]
pass_filenames: false
3 changes: 3 additions & 0 deletions docs/ext/snowflake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Snowflake

::: src.prefecto.ext.snowflake
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ nav:
- "Batch Task": concurrency/batch_task.md
- "Kill Switches": concurrency/kill_switch.md
- "Logging": logging.md
- "Extras":
- "Snowflake": ext/snowflake.md

plugins:
- search:
Expand Down
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,18 @@ classifiers = [
"Topic :: Software Development :: Libraries",
]
dependencies = [
"prefect>=2.10",
"prefect>=2.10.0",
]

[project.urls]
Documentation = "https://dominictarro.github.io/prefecto/"
Repository = "https://github.com/dominictarro/prefecto"

[project.optional-dependencies]
snowflake = [
"coolname>=2.2.0",
"snowflake-connector-python>=3.0.0",
]

[tool.interrogate]
exclude = ["tests/", "setup.py", "versioneer.py", "src/prefecto/_version.py"]
Expand All @@ -53,3 +57,13 @@ versionfile_source = "src/prefecto/_version.py"
versionfile_build = "prefecto/_version.py"
tag_prefix=""
parentdir_prefix="prefecto-"

[tool.uv]
dev-dependencies = [
"mkdocs>=1.4.3",
"mkdocstrings-python>=1.1.2",
"pre-commit>=3.5.0",
"pytest-asyncio>=0.23.6",
"pytest>=7.4.3",
"versioneer>=0.29",
]
6 changes: 0 additions & 6 deletions requirements-dev.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

6 changes: 6 additions & 0 deletions src/prefecto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
from . import _version

__version__ = _version.get_versions()["version"]

from . import (
blocks,
logging,
states,
)
Empty file added src/prefecto/ext/__init__.py
Empty file.
Loading
Loading