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
86 changes: 67 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Copied from bsoyka/template on GitHub
# Some lines may not be necessary for this project

#### PYTHON ####

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.py[codz]
*$py.class

# C extensions
Expand Down Expand Up @@ -51,7 +46,7 @@ htmlcov/
nosetests.xml
coverage.xml
*.cover
*.py,cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/
Expand Down Expand Up @@ -99,7 +94,37 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
#poetry.toml

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
#pdm.lock
#pdm.toml
.pdm-python
.pdm-build/

# pixi
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
#pixi.lock
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
# in the .venv directory. It is recommended not to include this directory in version control.
.pixi

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand All @@ -111,6 +136,7 @@ celerybeat.pid

# Environments
.env
.envrc
.venv
env/
venv/
Expand Down Expand Up @@ -142,14 +168,36 @@ dmypy.json
# Cython debug symbols
cython_debug/

#### VISUAL STUDIO CODE ####

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Marimo
marimo/_static/
marimo/_lsp/
__marimo__/

# Streamlit
.streamlit/secrets.toml
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ repos:
additional_dependencies:
- click
- pytest
- types-toml
ci:
autofix_commit_msg: "style: auto fixes from pre-commit hooks"
autofix_prs: true
Expand Down
4 changes: 3 additions & 1 deletion advent_of_code_ocr/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""A library to parse Advent of Code ASCII art."""

from importlib.metadata import version as get_version

from .height_6 import convert_6 as convert_6
from .height_6 import convert_array_6 as convert_array_6

__version__ = '1.1.0'
__version__ = get_version('advent_of_code_ocr')
4 changes: 3 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

from advent_of_code_ocr import __version__

project = 'Advent of Code OCR'
copyright = '2020-present Benjamin Soyka' # noqa: A001
author = 'Ben Soyka'
release = '1.1.0'
release = __version__

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ dev = [
"pre-commit>=4.2.0",
"pytest>=8.4.1",
"ruff>=0.12.5",
"toml>=0.10.2",
"types-toml>=0.10.8.20240310",
]
docs = [
"sphinx>=8.1.3",
Expand Down
15 changes: 15 additions & 0 deletions tests/init_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Test the package __init__ module."""

from pathlib import Path

import toml

from advent_of_code_ocr import __version__


def test_version() -> None:
"""Test that the package version matches the pyproject.toml."""
pyproject_path = Path(__file__).parent.parent / 'pyproject.toml'
pyproject = toml.load(pyproject_path)

assert __version__ == pyproject['project']['version']
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ wheel_build_env = .pkg
deps =
numpy>=2.0.2
pytest>=8.4.1
toml>=0.10.2
commands =
pytest {tty:--color=yes} {posargs}
22 changes: 22 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading