-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use uv for dependencies/environment setup
- Loading branch information
Showing
25 changed files
with
923 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Run tests | ||
run: uv run pytest tests | ||
- uses: k1LoW/octocov-action@v1 | ||
|
||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Run ruff check | ||
run: uv run ruff check --output-format github | ||
- name: Run pyright | ||
run: uv run pyright | ||
|
||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
- name: Run ruff format | ||
run: uv run ruff format --diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,24 +13,27 @@ jobs: | |
- name: checkout repo content | ||
uses: actions/checkout@v2 | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: "3.11" | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
- name: "Set up Python" | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
- name: Install the project | ||
run: uv sync --all-extras | ||
|
||
- name: build data | ||
run: python src/combine_data.py | ||
run: uv run loa_combine | ||
|
||
- name: Archive generated files as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: generated-files | ||
path: ./api | ||
path: ./dist | ||
|
||
- name: Checkout production branch | ||
uses: actions/checkout@v2 | ||
|
@@ -41,11 +44,11 @@ jobs: | |
uses: actions/download-artifact@v4 | ||
with: | ||
name: generated-files | ||
path: ./api | ||
path: ./dist | ||
|
||
- name: Apply changes to production branch | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git diff-index --quiet HEAD || (git commit -a -m "Add generated files from main branch" --allow-empty && git push origin production) | ||
git diff-index --quiet HEAD || (git commit -a -m "Add generated files from main branch" --allow-empty && git push origin production) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
*.pyc | ||
.vscode/* | ||
.vscode/* | ||
.direnv | ||
cov.xml | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
[project] | ||
name = "loa" | ||
version = "0.1.0" | ||
description = "Library for interacting with VATSIM LoA data" | ||
authors = [{ name = "Robin Gloster", email = "[email protected]" }, { name = "Leon Kleinschmidt" }] | ||
license = { file = "LICENSE-code" } | ||
readme = "README.md" | ||
requires-python = ">=3.12" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Developers", | ||
"Topic :: Games/Entertainment :: Simulation", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
|
||
dependencies = ["pydantic>=2.10.2", "regex>=2024.11.6", "requests>=2.32.3"] | ||
|
||
[project.scripts] | ||
loa_combine = "loa:combine" | ||
loa_check = "loa:check" | ||
|
||
[dependency-groups] | ||
dev = ["pyright>=1.1.389", "pytest>=8.3.3", "pytest-cov>=6.0.0", "ruff>=0.8.0"] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = ["--cov-report=term", "--cov-report=xml:cov.xml", "--cov=loa"] | ||
testpaths = ["tests"] | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
target-version = "py312" | ||
preview = true | ||
|
||
[tool.ruff.lint] | ||
select = [ | ||
"E", # pycodestyle errors | ||
"W", # pycodestyle warnings | ||
"F", # pyflakes | ||
"C90", # mccabe | ||
"I", # isort | ||
"ASYNC", # flake8-async | ||
"B", # flake8-bugbear | ||
"BLE", # flake8-blind-except | ||
"COM", # flake8-commas | ||
"C4", # flake8-comprehensions | ||
"DTZ", # flake8-datetimez | ||
"EM", # flake8-errmsg | ||
"ICN", # flake8-import-conventions | ||
"PYI", # flake8-pyi | ||
"Q", # flake8-quotes | ||
"SIM", # flake8-simplify | ||
"TCH", # flake8-typechecking | ||
"PTH", # flake8-use-pathlib | ||
"UP", # pyupgrade | ||
"RUF", # ruff-specific | ||
"TRY", # tryceratops | ||
"FURB", # refurb | ||
] | ||
ignore = ["COM812"] | ||
|
||
[tool.pyright] | ||
include = ["src/loa", "tests"] | ||
pythonVersion = "3.12" | ||
typeCheckingMode = "strict" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" |
Oops, something went wrong.