-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
13dafb0
commit d126d11
Showing
10 changed files
with
1,434 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.7 | ||
|
||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.4.2 | ||
|
||
- name: Install the package and dependencies | ||
run: | | ||
poetry install | ||
- name: Run tests | ||
run: | | ||
poetry run make all-checks |
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
poetry-check: | ||
@echo "🔒 Verifying that poetry.lock is consistent with pyproject.toml..." | ||
poetry lock --check | ||
|
||
format: | ||
isort . | ||
black . | ||
|
||
format-check: | ||
@echo "⚫ Checking code format..." | ||
isort --check-only --diff . | ||
black --check . | ||
|
||
type-check: | ||
@echo "👮 Running type checker" | ||
mypy . | ||
|
||
static-checks: poetry-check format-check type-check | ||
|
||
test: | ||
@echo "🏃 Running tests..." | ||
pytest . | ||
|
||
all-checks: static-checks test | ||
@echo "✅ Great success!" | ||
|
||
clean: | ||
rm -rf dist | ||
|
||
build: | ||
poetry build |
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry] | ||
name = "lightly-insights" | ||
version = "0.1.0" | ||
authors = ["Lightly.ai"] | ||
description = "A tool for converting computer vision label formats." | ||
readme = "README.md" | ||
license = "MIT" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.7" | ||
tqdm = "*" | ||
pillow = "*" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
mypy = "*" | ||
black = "*" | ||
isort = "*" | ||
flake8 = "*" | ||
pytest = "*" | ||
pytest-mock = "*" | ||
build = "*" | ||
twine = "*" | ||
types-Pillow = "*" | ||
|
||
# [tool.poetry.scripts] | ||
# labelformat = "lightly_insights.cli.cli:main" | ||
|
||
[tool.pytest.ini_options] | ||
pythonpath = [ | ||
".", "src/" | ||
] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.mypy] | ||
ignore_missing_imports = true | ||
python_version = 3.7 | ||
warn_unused_configs = true | ||
strict_equality = true | ||
# Disallow dynamic typing | ||
#disallow_any_unimported = true # because mypy fails to follow some imports, e.g. for PIL.Image.Image and matplotlib.Figure | ||
#disallow_any_expr = true # because intermediate expressions do not need to be typed | ||
disallow_any_decorated = true | ||
disallow_any_explicit = true | ||
disallow_any_generics = true | ||
disallow_subclassing_any = true | ||
# Disallow untyped definitions | ||
#disallow_untyped_calls = true # otherwise all external functions called must be typed e.g. calls to torch functions | ||
disallow_untyped_defs = true | ||
disallow_incomplete_defs = true | ||
check_untyped_defs = true | ||
disallow_untyped_decorators = true | ||
# None and optional handling | ||
no_implicit_optional = true | ||
strict_optional = true | ||
# Configuring warnings | ||
warn_unused_ignores = true | ||
warn_no_return = true | ||
warn_return_any = true | ||
warn_redundant_casts = true | ||
warn_unreachable = true | ||
|
||
# Print format | ||
show_error_codes = true | ||
show_error_context = true |
Empty file.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def main() -> None: | ||
print("Hello, world!") |
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from lightly_insights import main | ||
|
||
|
||
def test_main() -> None: | ||
main.main() | ||
assert True |