Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyproject #14

Merged
merged 3 commits into from
Jan 27, 2025
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
56 changes: 31 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,55 +12,55 @@ jobs:

lint:
name: Test Linting
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U black flake8
- name: Black
pip install ruff
- name: Ruff lint
run: |
black --check .
- name: Flake8
ruff check --output-format=github .
- name: Ruff format
run: |
flake8 . --max-line-length=99
ruff format --check .

docs:
name: Test docs
name: Test Docs
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
python-version: '3.12'
- name: Install dev dependencies
run: |
python -m pip install --upgrade pip
pip install -U sphinx
pip install -U -e .[docs]
- name: Build docs
run: |
cd docs
make html
make html SPHINXOPTS="-W --keep-going"

tests:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux py37
os: ubuntu-latest
pyversion: '3.7'
- name: Linux py38
os: ubuntu-latest
pyversion: '3.8'
Expand All @@ -76,24 +76,30 @@ jobs:
- name: Linux py312
os: ubuntu-latest
pyversion: '3.12'
- name: Windows py311
- name: Linux py313
os: ubuntu-latest
pyversion: '3.13'
#
- name: Windows py313
os: windows-latest
pyversion: '3.11'
- name: MacOS py311
pyversion: '3.13'
- name: MacOS py313
os: macos-latest
pyversion: '3.11'
pyversion: '3.13'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pyversion }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyversion }}
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install .
rm -rf ./itemdb.py ./build ./egg-info
- name: Test with pytest
run: |
pip install .
pytest -v --cov=itemdb .
4 changes: 3 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ version: 2
build:
os: ubuntu-lts-latest
tools:
python: "3.12"
python: "3.13"

sphinx:
configuration: docs/conf.py
Expand All @@ -17,3 +17,5 @@ python:
install:
- method: pip
path: .
extra_requirements:
- docs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018-2024 Almar Klein
Copyright (c) 2018-2025 Almar Klein

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ explicit transactions using a ``with`` statement. It provides a simple
object-based API, with the flexibility to store (JSON-compatible) items
with arbitrary fields, and add indices when needed.

This lib was originally part of the [TimeTurtle time tracker](https://timeturtle.app)
and is also used in [MyPaaS](https://github.com/almarklein/mypaas).
Originally developed as part of [TimaTagger](https://timetagger.app)
and [MyPaaS](https://github.com/almarklein/mypaas).


## Installation
Expand Down Expand Up @@ -89,6 +89,6 @@ MIT

## Developers

* Run `black .` to autoformat.
* Run `flake8 . --max-line-length=99` to lint.
* Run `pytest .` to run unit tests.
* Run `ruff format` to autoformat.
* Run `ruff check` to lint.
* Run `pytest tests` to run unit tests.
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = "itemdb"
copyright = "2018-2024, Almar Klein"
copyright = "2018-2025, Almar Klein"
author = "Almar Klein"
release = itemdb.__version__

Expand All @@ -35,6 +35,7 @@
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_rtd_theme",
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -53,7 +54,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = "sphinx_rtd_theme"
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
47 changes: 47 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Notes on how to do a release.
#
# * Bump `__version__` and commit.
# * git tag vx.y
# * git push origin main vx.y
# * flit publish

# ===== Project info

[project]
dynamic = ["version"]
name = "itemdb"
description = "Easy transactional database for Python dicts, backed by SQLite"
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "Almar Klein" }]
keywords = ["database", "sqlite", "no-sql"]
requires-python = ">= 3.7"
dependencies = []
[project.optional-dependencies]
lint = ["ruff"]
tests = ["pytest"]
docs = ["sphinx", "sphinx_rtd_theme"]
dev = ["itemdb[lint,tests, docs]"]

[project.urls]
Homepage = "https://github.com/almarklein/itemdb"
Documentation = "http://itemdb.readthedocs.io"
Repository = "https://github.com/almarklein/itemdb"


# ===== Building

# Flit is great solution for simple pure-Python projects.
[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"


# ===== Tooling

[tool.ruff]
line-length = 88

[tool.ruff.lint]
select = ["F", "E", "W", "B", "RUF"]
ignore = []
69 changes: 0 additions & 69 deletions setup.py

This file was deleted.

Loading