Skip to content

Commit

Permalink
Simple wrapper around docker API
Browse files Browse the repository at this point in the history
* fix linter settings
  • Loading branch information
piotr-grodek-dsai committed Nov 3, 2023
1 parent d3c4f3b commit 4d6bfc4
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 47 deletions.
26 changes: 10 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:

# PEP 8 compliant opinionated formatter.
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.10.1
hooks:
- id: black
exclude: (docs/)
Expand All @@ -23,7 +23,7 @@ repos:

# Cleaning unused imports.
- repo: https://github.com/hadialqattan/pycln
rev: v2.2.2
rev: v2.3.0
hooks:
- id: pycln
args: ["-a"]
Expand All @@ -38,7 +38,7 @@ repos:

# Used to have proper type annotations for library code.
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.6.1
hooks:
- id: mypy
args: []
Expand Down Expand Up @@ -73,19 +73,13 @@ repos:
hooks:
- id: pylint
exclude: (/test_|tests/|docs/)
# # You can add additional plugins for pylint here,
# here is an example for pydantic, remember to enable it in pyproject.toml
# additional_dependencies:
# - 'pylint_pydantic'
# args:
# # pylint can have issue with python libraries based on C
# # if it fails to find some objects likely you need to add them
# # here:
# ["--extension-pkg-whitelist=pydantic"]
additional_dependencies:
- 'docker>=6.1.3'

# Finds common security issues in Python code.
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
rev: v1.0.6
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: python-bandit-vulnerability-check
args: [-c, pyproject.toml, --recursive, src, -ll]
- id: bandit
args: [-c, pyproject.toml, --recursive, src]
additional_dependencies: [".[toml]"] # required for pyproject.toml support
33 changes: 8 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,15 @@ known_first_party=[
'ds_pycontain'
]
known_third_party=[ # Most popular libraries. Extend if necessary.
'IPython',
'PIL',
'cv2',
'dotenv',
'editdistance',
'fastapi',
'fire',
'hydra',
'joblib',
'loguru',
'luigi',
'matplotlib',
'neptune',
'neptune_config',
'nltk',
'numpy',
'omegaconf',
'pandas',
'pqdm',
'pydantic',
'pytest',
'pytorch_lightning',
'requests',
'scipy',
'setuptools',
'shapely',
'skimage',
'sklearn',
'streamlit',
'torch',
'torchvision',
'tqdm',
'typer',
'docker',
]
skip_gitignore=true

Expand Down Expand Up @@ -95,6 +71,10 @@ module = "ds_pycontain.*"
ignore_missing_imports = false
disallow_untyped_defs = true

[[tool.mypy.overrides]]
module = "docker.*"
ignore_errors = true

[tool.pylint.basic]
good-names="""i,j,x,y,z,x1,y1,z1,x2,y2,z2,cv,df,dx,dy,dz,w,h,c,b,g,qa,q,a""""
max-args=8
Expand Down Expand Up @@ -140,3 +120,6 @@ min-similarity-lines=10

[tool.bandit]
exclude_dirs = ["venv",]
# B101 disables errors for asserts in the code
# remember to not use asserts for security and control flows
skips = ["B101"]
5 changes: 3 additions & 2 deletions src/ds_pycontain/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
""" ds_pycontain """
""" ds_pycontain is a Python package for managing Docker containers and images. """
from .__version__ import __version__
from .docker_containers import DockerContainer, DockerImage, generate_random_container_tag, get_docker_client

__all__ = ["__version__"]
__all__ = ["__version__", "DockerContainer", "DockerImage", "generate_random_container_tag", "get_docker_client"]
Loading

0 comments on commit 4d6bfc4

Please sign in to comment.