Skip to content
Open
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
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/
*.pytest_cache
.pytest_cache/*

# Translations
*.mo
Expand Down Expand Up @@ -119,3 +122,13 @@ credentials.json

# Default work dir
work

# Poetry
poetry.lock

# Claude settings
.claude/*

# Testing artifacts
test-results/
.benchmarks/
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.PHONY: test tests coverage clean

test:
poetry run pytest

tests:
poetry run pytest

coverage:
poetry run pytest --cov-report=term-missing --cov-report=html

clean:
rm -rf .pytest_cache
rm -rf htmlcov
rm -f coverage.xml
rm -f .coverage
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
168 changes: 168 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
[tool.poetry]
name = "soweego"
version = "1.0.0"
description = "A Wikidata bot for entity linking"
authors = ["Marco Fossati <[email protected]>"]
license = "GPL-3.0"
readme = "README.md"
repository = "https://github.com/Wikidata/soweego"
keywords = ["wikidata", "entity-linking", "record-linkage"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Information Analysis",
]
packages = [{include = "soweego"}]

[tool.poetry.dependencies]
python = "^3.8.1"
click = "^8.0.0"
jellyfish = "^0.9.0"
joblib = "^1.0.0"
keras = "^2.0.0"
lxml = "^4.0.0"
mlens = "^0.2.0"
numpy = "^1.0.0"
pandas = "^1.0.0"
pywikibot = "^7.0.0"
recordlinkage = "^0.15.0"
regex = "^2022.0.0"
requests = "^2.0.0"
scikit-learn = "^1.0.0"
sqlalchemy = "^1.4.0"
tensorflow = "^2.0.0"
tqdm = "^4.0.0"
urllib3 = "^1.26.0"
matplotlib = "^3.0.0"
seaborn = "^0.11.0"

[tool.poetry.group.dev.dependencies]
pytest = "^7.4.0"
pytest-cov = "^4.1.0"
pytest-mock = "^3.11.0"
black = "^23.0.0"
isort = "^5.12.0"
flake8 = "^6.0.0"
mypy = "^1.4.0"
pre-commit = "^3.3.0"

[tool.poetry.scripts]
soweego = "soweego.cli:cli"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
minversion = "7.0"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=soweego",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-report=html:htmlcov",
"--cov-report=xml:coverage.xml",
# "--cov-fail-under=80", # Uncomment when actual tests are written
"-vv"
]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow running tests"
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning"
]

[tool.coverage.run]
source = ["soweego"]
branch = true
parallel = true
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/site-packages/*",
"*/distutils/*",
"*/.venv/*",
"*/venv/*"
]

[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = true
# fail_under = 80 # Uncomment when actual tests are written
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
"except ImportError:",
"pass"
]

[tool.coverage.html]
directory = "htmlcov"

[tool.coverage.xml]
output = "coverage.xml"

[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true

[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310']
include = '\.pyi?$'
exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| tests/fixtures
)/
'''

[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
disallow_any_generics = false
ignore_missing_imports = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
strict_equality = true
Empty file added tests/__init__.py
Empty file.
Loading