Skip to content

Commit

Permalink
Project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermalyga committed Jan 3, 2024
1 parent c1141bc commit 5878213
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Integration
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "1.2.2"
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install --no-interaction --no-root
- name: Install project
run: poetry install --no-interaction
- name: Run checks
run: |
source .venv/bin/activate
make check
- name: Run tests
run: |
source .venv/bin/activate
make test
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish
on:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "1.2.2"
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Publish
run: |
poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
poetry version $(git describe --tags --abbrev=0)
poetry publish --build
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sources = geodantic tests

.PHONY: test lint check

test:
pytest -vv --cov=geodantic tests

lint:
isort $(sources)
black $(sources)

check:
isort --check --diff $(sources)
black --check --diff $(sources)
mypy -p geodantic
Empty file added geodantic/__init__.py
Empty file.
Empty file added geodantic/py.typed
Empty file.
469 changes: 469 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[tool.poetry]
name = "geodantic"
version = "0.0.0"
description = "GeoJSON parsing and validation using Pydantic"
authors = ["Alexander Malyga <alexander@malyga.io>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/alexandermalyga/geodantic"
repository = "https://github.com/alexandermalyga/geodantic"

[tool.poetry.dependencies]
python = "^3.12"
pydantic = "^2.5.3"

[tool.poetry.group.dev.dependencies]
mypy = "^1.8.0"
black = "^23.12.1"
isort = "^5.13.2"
pytest = "^7.4.4"
pytest-cov = "^4.1.0"

[tool.mypy]
strict = true

[tool.black]
target_version = ["py312"]

[tool.isort]
profile = "black"

[tool.coverage.report]
exclude_lines = ["pragma: not covered", "@overload"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Empty file added tests/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions tests/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def test_dummy() -> None:
assert True

0 comments on commit 5878213

Please sign in to comment.