Skip to content
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
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Python build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install UV
uses: astral-sh/setup-uv@v6
- name: Install venv
run: uv venv
- name: Check ruff
run: uvx ruff check
- name: Static analysis with mypy
run: uv run mypy tilelog
55 changes: 55 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
name: Python package
on:
workflow_dispatch:
push:
branches: [main]
tags: "v*"
pull_request:
release:
types: [published]
jobs:
package:
name: Build & inspect our package.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: hynek/build-and-inspect-python-package@v2
publish-to-testpypi:
name: Upload release to TestPyPI
needs: [package]
runs-on: ubuntu-latest
if: github.event_name == 'push'
environment:
name: testpypi
url: https://test.pypi.org/p/tilekiln
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

publish-to-pypi:
name: Publish tagged versions to PyPi
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [publish-to-testpypi]
environment:
name: pypi
url: https://pypi.org/p/tilekiln
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
30 changes: 1 addition & 29 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,7 @@ __pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
uv.lock

.venv
venv/
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ Tilelog is used to generate [tile logs](https://planet.openstreetmap.org/tile_lo

## Install

For local development
For local development install [uv](https://github.com/astral-sh/uv) and

```sh
python3 -m venv venv
. venv/bin/activate
pip install --editable .
uv venv
uv run tilelog --help
```

## Usage
Expand Down
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[project]
name = "tilelog"
dynamic = ["version"]
description = "Process OpenStreetMap tile logs"
readme = "README.md"
license = "GPL-3.0-or-later"
requires-python = ">=3.10, <4"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3"
]
dependencies = [
"Click",
"publicsuffixlist",
"pyathena",
"PyAthena[Arrow]"
]

[project.scripts]
tilelog = "tilelog:cli"

[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"

[tool.hatch.version]
source = "vcs"

# Allows pypi uploads. ref: https://github.com/ofek/hatch-vcs/discussions/12
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"

[tool.ruff]
line-length = 100

[[tool.mypy.overrides]]
module = ["publicsuffixlist.*"]
follow_untyped_imports = true

[dependency-groups]
dev = [
"mypy>=1.18.2",
]
35 changes: 0 additions & 35 deletions setup.py

This file was deleted.

2 changes: 0 additions & 2 deletions tox.ini

This file was deleted.

Loading