-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e854aad
commit af13a56
Showing
5 changed files
with
158 additions
and
38 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,88 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- "master" | ||
pull_request: | ||
branches: | ||
- "master" | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ['pypy-3.9', 3.9, '3.10', 'pypy-3.10', '3.11', '3.12', '3.13'] | ||
cython: ['yes', 'no'] | ||
include: | ||
- os: ubuntu-latest | ||
path: ~/.cache/pip | ||
- os: macos-latest | ||
path: ~/Library/Caches/pip | ||
- os: windows-latest | ||
path: ~\AppData\Local\pip\Cache | ||
exclude: | ||
- os: macos-latest | ||
python-version: 'pypy-3.9' | ||
- os: macos-latest | ||
python-version: 'pypy-3.10' | ||
- os: windows-latest | ||
python-version: 'pypy-3.9' | ||
- os: windows-latest | ||
python-version: 'pypy-3.10' | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
PYTHONIOENCODING: UTF-8 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache Install | ||
id: restore-cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: | | ||
${{ matrix.path }} | ||
poetry.lock | ||
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('tests/requirements.txt') }} | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: '1.8.3' # ${{ startsWith(matrix.python-version, 'pypy') && '1.2.2' || '1.8.3' }} | ||
virtualenvs-create: false | ||
|
||
- name: Install | ||
run: poetry install | ||
|
||
- name: Build Cython file | ||
run: | | ||
poetry run pip install cython | ||
poetry run cythonize -i geohash_hilbert/*.pyx | ||
poetry show | ||
python -c 'import geohash_hilbert as ghh; print(ghh._hilbert.CYTHON_AVAILABLE)' | ||
- name: Style | ||
if: ${{ ! startsWith(matrix.python-version, 'pypy-') && startsWith(matrix.os, 'ubuntu') }} | ||
run: make check | ||
|
||
- name: Tests | ||
run: make test | ||
|
||
- uses: codecov/codecov-action@v4 | ||
with: | ||
file: coverage.xml | ||
name: coverage-${{ matrix.os }}-${{ matrix.python-version }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true |
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,37 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
workflow_dispatch: | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
environment: pypi | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set Up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.8.3 | ||
|
||
- name: Build | ||
run: poetry build -vvv -f sdist | ||
|
||
- name: Archive artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
- name: Publish | ||
run: poetry publish -vvv -n -u __token__ -p ${{ secrets.PYPI_PASS }} |
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,13 @@ | ||
.PHONY: fmt check test | ||
|
||
fmt: | ||
poetry run ruff format . | ||
poetry run ruff check --fix . | ||
|
||
check: | ||
poetry run ruff format --check . | ||
poetry run ruff check . | ||
# poetry run mypy geohash_hilbert | ||
|
||
test: | ||
PYTHONDEVMODE=1 poetry run pytest -vvv -s |
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,7 +1,7 @@ | ||
[tool.poetry] | ||
|
||
name = "geohash-hilbert" | ||
version = "1.4.0" | ||
version = "2.0.0" | ||
description = "Geohash a lng/lat coordinate using the hilbert curve." | ||
authors = ["Tammo Ippen <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -22,38 +22,30 @@ classifiers = [ | |
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Python :: 3.11', | ||
'Programming Language :: Python :: 3.12', | ||
'Programming Language :: Python :: 3.13', | ||
'Programming Language :: Python :: Implementation :: CPython', | ||
'Programming Language :: Python :: Implementation :: PyPy' | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
|
||
python = "~2.7 || ^3.5" | ||
|
||
[tool.poetry.dev-dependencies] | ||
|
||
coveralls = "^1.5.1" | ||
flake8 = "^3.5.0" | ||
flake8-bugbear = { version = "^18.8.0", python = "^3.5" } | ||
flake8-commas = "^2.0.0" | ||
flake8-comprehensions = "^1.4.1" | ||
flake8-import-order = "^0.18" | ||
flake8-pep3101 = "^1.2.1" | ||
flake8-polyfill = "^1.0.2" | ||
flake8-quotes = "^1.0.0" | ||
pep8-naming = "^0.7" | ||
pytest = "^3.7.3" | ||
pytest-benchmark = "^3.1.1" | ||
pytest-cov = "^2.5.1" | ||
pytest-flake8 = "^1.0.2" | ||
pytest-mccabe = "^0.1" | ||
pytest-pythonpath = "^0.7.3" | ||
six = "^1.11.0" | ||
python = "^3.9" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
|
||
ruff = "*" | ||
coveralls = "*" | ||
pytest = "*" | ||
pytest-benchmark = "*" | ||
pytest-cov = "*" | ||
cython = { version = "*", optional = true } | ||
|
||
[tool.poetry.extras] | ||
cython = ["cython"] | ||
|
||
[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