-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from gb-libs/up-workflow
💡 up python and add new workflow
- Loading branch information
Showing
20 changed files
with
931 additions
and
160 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
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
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,28 @@ | ||
# This workflow will upload a Python Package using poetry when a release is created | ||
# Note that you must manually update the version number in pyproject.toml before attempting this. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Build and publish to pypi | ||
uses: JRubics/[email protected] | ||
with: | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} |
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,36 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: debug-statements | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.13.0 | ||
hooks: | ||
- id: mypy | ||
pass_filenames: false | ||
|
||
- repo: https://github.com/python-poetry/poetry | ||
rev: '1.8.5' | ||
hooks: | ||
- id: poetry-check | ||
- id: poetry-lock | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.2 | ||
hooks: | ||
- id: ruff | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: isort (python) |
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,25 @@ | ||
.PHONY: help lint ruff-fix clean test | ||
|
||
|
||
help: ## Display this help screen | ||
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
||
lint: ## Auto fix lint | ||
pre-commit run --all-files | ||
|
||
ruff-fix: ## Auto fix lint ruff | ||
ruff check . --fix | ||
|
||
clean: ## Clear temp files | ||
rm -rf `find . -name __pycache__` | ||
rm -f `find . -type f -name '*.py[co]' ` | ||
rm -f `find . -type f -name '*~' ` | ||
rm -f `find . -type f -name '.*~' ` | ||
rm -rf dist *.egg-info | ||
rm -rf .cache | ||
rm -rf .pytest_cache | ||
rm -f .coverage | ||
rm -f .coverage.* | ||
|
||
test: ## Run tests | ||
pytest --cov=pydantic_geojson --cov-report=xml |
Large diffs are not rendered by default.
Oops, something went wrong.
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,4 +1,4 @@ | ||
from typing import Union, Any | ||
from typing import Any, Union | ||
|
||
from pydantic import BaseModel | ||
|
||
|
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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "pydantic_geojson" | ||
version = "0.1.1" | ||
version = "0.2.0" | ||
description = "Pydantic validation for GeoJson" | ||
authors = [ | ||
"Aliaksandr Vaskevich <[email protected]>", | ||
|
@@ -31,26 +31,25 @@ classifiers = [ | |
"Topic :: Scientific/Engineering :: GIS", | ||
"Intended Audience :: Developers", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"License :: OSI Approved :: MIT License", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.7" | ||
python = "^3.9" | ||
pydantic = ">=1.9,<3.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
isort = "^5.10.1" | ||
pytest = "^7.1.1" | ||
pytest-cov = "^4.0.0" | ||
mypy = "^1.4.1" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
bandit = "^1.7.5" | ||
isort = "^5.13.2" | ||
pytest = "^8.3.4" | ||
pytest-cov = "^6.0.0" | ||
mypy = "^1.13.0" | ||
pre-commit = "^4.0.1" | ||
|
||
[build-system] | ||
requires = ["poetry>=0.12"] | ||
|
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
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
Oops, something went wrong.