-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use uv instead of poetry and local test for matrix of python versions
- Loading branch information
1 parent
229f80b
commit d1bc2e4
Showing
8 changed files
with
1,903 additions
and
2,613 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 |
---|---|---|
@@ -1,25 +1,51 @@ | ||
default: | ||
@just --list | ||
|
||
[group('package')] | ||
publish: | ||
uv publish --build | ||
|
||
[group('lint')] | ||
format: | ||
# Source code | ||
poetry run black spacypdfreader | ||
poetry run isort spacypdfreader | ||
# Tests | ||
poetry run black tests | ||
poetry run isort tests | ||
# Sort imports | ||
uvx ruff check --select I --fix . | ||
# Format code | ||
uvx ruff format . | ||
|
||
[group('lint')] | ||
lint: | ||
uvx ruff check . | ||
|
||
test: | ||
poetry run pytest | ||
poetry run pytest --doctest-modules spacypdfreader/ | ||
[group('tests')] | ||
test version="3.12": | ||
uv run --python {{version}} --all-extras pytest | ||
|
||
[group('tests')] | ||
test-matrix: | ||
just test 3.9 | ||
just test 3.10 | ||
just test 3.11 | ||
just test 3.12 | ||
|
||
[group('tests')] | ||
test-pre-release-python: | ||
# As of 2024-10-04 3.13 is failing | ||
just test 3.13 | ||
|
||
[group('tests')] | ||
test-gha: | ||
gh workflow run pytest.yml --ref $(git branch --show-current) | ||
|
||
[group('docs')] | ||
preview-docs: | ||
poetry run mkdocs serve | ||
uv run mkdocs serve | ||
|
||
[group('docs')] | ||
publish-docs: | ||
rm -rf site | ||
mkdocs build | ||
mkdocs gh-deploy | ||
uv run mkdocs build | ||
uv run mkdocs gh-deploy | ||
|
||
publish: | ||
poetry publish --build | ||
[group('docs')] | ||
test-docs: | ||
uv run --python 3.12 --all-extras pytest --doctest-modules spacypdfreader/ |
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 was deleted.
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,36 +1,76 @@ | ||
[tool.poetry] | ||
[project] | ||
name = "spacypdfreader" | ||
version = "0.3.2" | ||
description = "A PDF to text extraction pipeline component for spaCy." | ||
authors = ["SamEdwardes <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
repository = "https://github.com/SamEdwardes/spaCyPDFreader" | ||
keywords = ["python", "spacy", "nlp", "pdf", "pdfs"] | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"pdfminer-six>=20240706", | ||
"rich>=13.9.2", | ||
"spacy>=3.8.2", | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.8,<4.0" | ||
spacy = "^3.4" | ||
rich = "^10.15.2" | ||
"pdfminer.six" = "^20211012" | ||
pytesseract = {version = "^0.3.8", optional = true} | ||
pdf2image = {version = "^1.16.0", optional = true} | ||
numpy = "^1.24.2" | ||
Pillow = {version = "^9.4.0", optional = true} | ||
|
||
[tool.poetry.extras] | ||
pytesseract = ["pytesseract", "Pillow", "pdf2image"] | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
pytest = "^6.2.5" | ||
en-core-web-sm = {url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.1/en_core_web_sm-3.4.1-py3-none-any.whl"} | ||
mkdocs-material = "^9.1.1" | ||
mkdocs-include-markdown-plugin = {version = "^4.0.3", python = "<=3.11"} | ||
mkdocstrings = {extras = ["python"], version = "^0.20.0"} | ||
ipykernel = "^6.25.2" | ||
black = "^23.9.1" | ||
isort = "^5.12.0" | ||
[project.optional-dependencies] | ||
pytesseract = [ | ||
"pdf2image>=1.17.0", | ||
"pillow>=10.4.0", | ||
"pytesseract>=0.3.13", | ||
] | ||
|
||
|
||
# [tool.poetry] | ||
# name = "spacypdfreader" | ||
# version = "0.3.2" | ||
# description = "A PDF to text extraction pipeline component for spaCy." | ||
# authors = ["SamEdwardes <[email protected]>"] | ||
# license = "MIT" | ||
# readme = "README.md" | ||
# repository = "https://github.com/SamEdwardes/spaCyPDFreader" | ||
# keywords = ["python", "spacy", "nlp", "pdf", "pdfs"] | ||
|
||
# [tool.poetry.dependencies] | ||
# python = ">=3.9,<4.0" | ||
# spacy = "^3.7.6" | ||
# rich = "^10.15.2" | ||
# "pdfminer.six" = "^20211012" | ||
# pytesseract = {version = "^0.3.8", optional = true} | ||
# pdf2image = {version = "^1.16.0", optional = true} | ||
# numpy = "^1.25.0" | ||
# Pillow = {version = "^9.4.0", optional = true} | ||
|
||
# [tool.poetry.extras] | ||
# pytesseract = ["pytesseract", "Pillow", "pdf2image"] | ||
|
||
# [tool.poetry.group.dev.dependencies] | ||
# pytest = "^6.2.5" | ||
# en-core-web-sm = {url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.1/en_core_web_sm-3.4.1-py3-none-any.whl"} | ||
# mkdocs-material = "^9.1.1" | ||
# mkdocs-include-markdown-plugin = {version = "^4.0.3", python = "<=3.11"} | ||
# mkdocstrings = {extras = ["python"], version = "^0.20.0"} | ||
# ipykernel = "^6.25.2" | ||
# black = "^23.9.1" | ||
# isort = "^5.12.0" | ||
|
||
# [build-system] | ||
# requires = ["poetry-core>=1.0.0"] | ||
# build-backend = "poetry.core.masonry.api" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"mkdocs>=1.6.1", | ||
"mkdocs-include-markdown-plugin>=6.2.2", | ||
"mkdocs-material>=9.5.39", | ||
"pytest>=8.3.3", | ||
"en-core-web-sm", | ||
"mkdocstrings>=0.26.1", | ||
"mkdocstrings-python>=1.11.1", | ||
] | ||
|
||
[tool.uv.sources] | ||
en-core-web-sm = { url = "https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl" } |
Oops, something went wrong.