kopia lustrzana https://github.com/jedie/PyInventory
commit
f6aa85946c
|
@ -1,4 +1,4 @@
|
|||
# see http://editorconfig.org
|
||||
# see https://editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
|
@ -9,14 +9,12 @@ charset = utf-8
|
|||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
[*.{bat,cmd,ps1}]
|
||||
end_of_line = crlf
|
||||
|
||||
[*.{html,css,js}]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.py]
|
||||
max_line_length = 100
|
||||
max_line_length = 119
|
||||
|
||||
[{Makefile,**.mk}]
|
||||
indent_style = tab
|
||||
insert_final_newline = false
|
||||
|
||||
[*.yml]
|
||||
indent_size = 2
|
||||
|
|
|
@ -14,33 +14,31 @@ jobs:
|
|||
test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
max-parallel: 2
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest] # TODO: macOS-latest, windows-latest
|
||||
python-version: ["3.11", "3.10", "3.9"]
|
||||
env:
|
||||
PYTHONUNBUFFERED: 1
|
||||
PYTHONWARNINGS: always
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: 'fetch main'
|
||||
- name: Checkout
|
||||
run: |
|
||||
git fetch origin main
|
||||
echo $GITHUB_REF $GITHUB_SHA
|
||||
git clone --depth 1 https://github.com/$GITHUB_REPOSITORY.git .
|
||||
git fetch origin $GITHUB_SHA:temporary-ci-branch
|
||||
git checkout $GITHUB_SHA || (git fetch && git checkout $GITHUB_SHA)
|
||||
|
||||
- name: 'Set up Python ${{ matrix.python-version }}'
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
# https://github.com/marketplace/actions/setup-python
|
||||
with:
|
||||
python-version: '${{ matrix.python-version }}'
|
||||
cache: 'pip' # caching pip dependencies
|
||||
cache-dependency-path: '**/poetry.lock'
|
||||
|
||||
- name: 'Bootstrap'
|
||||
run: |
|
||||
python3 devshell.py quit
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/
|
||||
key: dot-cache-files
|
||||
|
||||
- name: 'Install Browsers for Playwright tests'
|
||||
run: |
|
||||
|
@ -55,7 +53,8 @@ jobs:
|
|||
python3 devshell.py pytest -vv
|
||||
|
||||
- name: 'Upload coverage report'
|
||||
uses: codecov/codecov-action@v2
|
||||
uses: codecov/codecov-action@v3
|
||||
# https://github.com/marketplace/actions/codecov
|
||||
with:
|
||||
fail_ci_if_error: false
|
||||
verbose: true
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
.*
|
||||
*.egg-info
|
||||
__pycache__
|
||||
coverage.json
|
||||
/dist/
|
||||
/coverage.json
|
||||
/coverage.xml
|
||||
|
||||
!.github
|
||||
!.editorconfig
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
Web based management to catalog things including state and location etc. using Python/Django.
|
||||
Store information in WYSIWYG-HTML-Editor field and tag them and add Files, Images and Links to them.
|
||||
|
||||
[![Test](https://github.com/jedie/PyInventory/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/jedie/PyInventory/actions/workflows/ci.yml)
|
||||
[![Coverage Status on codecov.io](https://codecov.io/gh/jedie/PyInventory/branch/main/graph/badge.svg)](https://codecov.io/gh/jedie/PyInventory)
|
||||
[![tests](https://github.com/jedie/PyInventory/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jedie/PyInventory/actions/workflows/tests.yml)
|
||||
[![codecov](https://codecov.io/github/jedie/PyInventory/branch/main/graph/badge.svg)](https://app.codecov.io/github/jedie/PyInventory)
|
||||
[![PyInventory @ PyPi](https://img.shields.io/pypi/v/PyInventory?label=PyInventory%20%40%20PyPi)](https://pypi.org/project/PyInventory/)
|
||||
[![Python Versions](https://img.shields.io/pypi/pyversions/PyInventory)](https://github.com/jedie/PyInventory/blob/main/pyproject.toml)
|
||||
[![License GPL](https://img.shields.io/pypi/l/PyInventory)](https://github.com/jedie/PyInventory/blob/main/LICENSE)
|
||||
[![License GPL-3.0-or-later](https://img.shields.io/pypi/l/PyInventory)](https://github.com/jedie/PyInventory/blob/main/LICENSE)
|
||||
|
||||
[![Install PyInventory with YunoHost](https://install-app.yunohost.org/install-with-yunohost.svg)](https://install-app.yunohost.org/?app=pyinventory)
|
||||
|
||||
|
|
Plik diff jest za duży
Load Diff
|
@ -80,7 +80,6 @@ pytest-randomly = "*"
|
|||
pytest-cov = "*"
|
||||
pytest-django = "*"
|
||||
pytest-playwright = "*" # https://playwright.dev/python/docs/test-runners
|
||||
flynt = "*"
|
||||
pyupgrade = "*"
|
||||
model_bakery = "*" # https://github.com/model-bakers/model_bakery
|
||||
beautifulsoup4 = "*"
|
||||
|
@ -88,16 +87,23 @@ lxml = "*"
|
|||
requests-mock = "*"
|
||||
tox = "*" # https://github.com/tox-dev/tox
|
||||
coveralls = "*" # http://github.com/TheKevJames/coveralls-python
|
||||
darker = "*" # https://github.com/akaihola/pytest-darker
|
||||
isort = "*" # https://github.com/pycqa/isort
|
||||
flake8 = "*" # https://github.com/pycqa/flake8
|
||||
EditorConfig = "*" # https://github.com/editorconfig/editorconfig-core-py
|
||||
safety = "*" # https://github.com/pyupio/safety
|
||||
mypy = "*" # https://github.com/python/mypy
|
||||
tomli = "*" # https://github.com/hukkin/tomli
|
||||
packaging = "*" # https://github.com/pypa/packaging
|
||||
twine = "*" # https://github.com/pypa/twine
|
||||
poetry-publish = "*" # https://github.com/jedie/poetry-publish
|
||||
|
||||
# https://github.com/akaihola/darker
|
||||
# https://github.com/ikamensh/flynt
|
||||
# https://github.com/pycqa/isort
|
||||
# https://github.com/pygments/pygments
|
||||
darker = { version = "*", extras = ["flynt", "isort", "color"]}
|
||||
|
||||
tomli = "*" # https://github.com/hukkin/tomli
|
||||
# tomli only needed for Python <3.11, but see bug:
|
||||
# https://github.com/pypa/pip/issues/9644#issuecomment-1456583402
|
||||
#tomli = {version = "*", markers = "python_version < \"3.11\""} # https://github.com/hukkin/tomli
|
||||
|
||||
[tool.poetry.scripts]
|
||||
devshell = 'inventory_project.dev_shell:devshell_cmdloop'
|
||||
|
@ -112,35 +118,49 @@ build-backend = "poetry.core.masonry.api"
|
|||
[tool.darker]
|
||||
src = ['.']
|
||||
revision = "origin/main..."
|
||||
line_length = 100
|
||||
line_length = 119
|
||||
verbose = true
|
||||
color = true
|
||||
skip_string_normalization = true
|
||||
diff = false
|
||||
check = false
|
||||
stdout = false
|
||||
isort = true
|
||||
flynt = true
|
||||
lint = [
|
||||
"flake8",
|
||||
]
|
||||
log_level = "INFO"
|
||||
|
||||
|
||||
[tool.flynt]
|
||||
line_length = 100
|
||||
|
||||
|
||||
[tool.isort]
|
||||
# https://pycqa.github.io/isort/docs/configuration/config_files/#pyprojecttoml-preferred-format
|
||||
atomic=true
|
||||
profile='black'
|
||||
line_length = 100
|
||||
skip_glob=[".*", "*/htmlcov/*","*/migrations/*","*/volumes/*"]
|
||||
known_first_party=["inventory","inventory_project","inventory_tests"]
|
||||
line_length=119
|
||||
lines_after_imports=2
|
||||
|
||||
|
||||
[tool.coverage.run]
|
||||
omit = [".*"]
|
||||
branch = false # coverage.exceptions.DataError: Can't combine arc data with line data
|
||||
parallel = true
|
||||
source = ['.']
|
||||
concurrency = ["multiprocessing"]
|
||||
command_line = "-m unittest --locals --verbose"
|
||||
|
||||
[tool.coverage.report]
|
||||
omit = ['.*', '*/tests/*']
|
||||
skip_empty = true
|
||||
fail_under = 30
|
||||
show_missing = true
|
||||
exclude_lines = [
|
||||
'if self.debug:',
|
||||
'pragma: no cover',
|
||||
'raise NotImplementedError',
|
||||
'if __name__ == .__main__.:',
|
||||
]
|
||||
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
|
@ -182,12 +202,11 @@ addopts = """
|
|||
# TODO: --mypy
|
||||
|
||||
|
||||
[tool.tox]
|
||||
# https://tox.readthedocs.io/en/latest/example/basic.html#pyproject-toml-tox-legacy-ini
|
||||
[tool.tox] # https://tox.wiki/en/latest/config.html#pyproject-toml
|
||||
legacy_tox_ini = """
|
||||
[tox]
|
||||
isolated_build = True
|
||||
envlist = py{39,310,311}
|
||||
envlist = py{311,310,39}
|
||||
skip_missing_interpreters = True
|
||||
|
||||
[testenv]
|
||||
|
@ -214,6 +233,9 @@ initial_revision = "b33d693"
|
|||
initial_date = 2022-12-21T22:53:08+01:00
|
||||
cookiecutter_template = "https://github.com/jedie/cookiecutter_templates/"
|
||||
cookiecutter_directory = "poetry-python"
|
||||
applied_migrations = [
|
||||
"183124a", # 2023-04-04T12:26:15+02:00
|
||||
]
|
||||
|
||||
[manageprojects.cookiecutter_context.cookiecutter]
|
||||
full_name = "Jens Diemer"
|
||||
|
|
|
@ -7,12 +7,7 @@ from django.utils.translation import gettext_lazy as _
|
|||
from import_export.admin import ImportExportMixin
|
||||
from import_export.resources import ModelResource
|
||||
|
||||
from inventory.admin.base import (
|
||||
BaseFileModelInline,
|
||||
BaseImageModelInline,
|
||||
BaseUserAdmin,
|
||||
UserInlineMixin,
|
||||
)
|
||||
from inventory.admin.base import BaseFileModelInline, BaseImageModelInline, BaseUserAdmin, UserInlineMixin
|
||||
from inventory.admin.tagulous_fix import TagulousModelAdminFix
|
||||
from inventory.models import MemoLinkModel, MemoModel
|
||||
from inventory.models.memo import MemoFileModel, MemoImageModel
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
from unittest import mock
|
||||
|
||||
from bx_django_utils.test_utils.html_assertion import (
|
||||
HtmlAssertionMixin,
|
||||
assert_html_response_snapshot,
|
||||
)
|
||||
from bx_django_utils.test_utils.html_assertion import HtmlAssertionMixin, assert_html_response_snapshot
|
||||
from django.template.defaulttags import CsrfTokenNode, NowNode
|
||||
from django.test import TestCase, override_settings
|
||||
|
||||
|
|
|
@ -2,10 +2,7 @@ import datetime
|
|||
from unittest import mock
|
||||
|
||||
from bx_django_utils.test_utils.datetime import MockDatetimeGenerator
|
||||
from bx_django_utils.test_utils.html_assertion import (
|
||||
HtmlAssertionMixin,
|
||||
assert_html_response_snapshot,
|
||||
)
|
||||
from bx_django_utils.test_utils.html_assertion import HtmlAssertionMixin, assert_html_response_snapshot
|
||||
from bx_py_utils.test_utils.snapshot import assert_html_snapshot
|
||||
from django.template.defaulttags import CsrfTokenNode, NowNode
|
||||
from django.test import TestCase, override_settings
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
from unittest import mock
|
||||
|
||||
from bx_django_utils.test_utils.html_assertion import (
|
||||
HtmlAssertionMixin,
|
||||
assert_html_response_snapshot,
|
||||
)
|
||||
from bx_django_utils.test_utils.html_assertion import HtmlAssertionMixin, assert_html_response_snapshot
|
||||
from django.contrib.auth.models import User
|
||||
from django.template.defaulttags import CsrfTokenNode, NowNode
|
||||
from django.test import TestCase, override_settings
|
||||
|
|
Ładowanie…
Reference in New Issue