Skip to content

Commit 4d6bfc4

Browse files
Simple wrapper around docker API
* fix linter settings
1 parent d3c4f3b commit 4d6bfc4

File tree

6 files changed

+425
-47
lines changed

6 files changed

+425
-47
lines changed

.pre-commit-config.yaml

+10-16
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414

1515
# PEP 8 compliant opinionated formatter.
1616
- repo: https://github.com/psf/black
17-
rev: 23.9.1
17+
rev: 23.10.1
1818
hooks:
1919
- id: black
2020
exclude: (docs/)
@@ -23,7 +23,7 @@ repos:
2323

2424
# Cleaning unused imports.
2525
- repo: https://github.com/hadialqattan/pycln
26-
rev: v2.2.2
26+
rev: v2.3.0
2727
hooks:
2828
- id: pycln
2929
args: ["-a"]
@@ -38,7 +38,7 @@ repos:
3838

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

8679
# Finds common security issues in Python code.
87-
- repo: https://github.com/Lucas-C/pre-commit-hooks-bandit
88-
rev: v1.0.6
80+
- repo: https://github.com/PyCQA/bandit
81+
rev: 1.7.5
8982
hooks:
90-
- id: python-bandit-vulnerability-check
91-
args: [-c, pyproject.toml, --recursive, src, -ll]
83+
- id: bandit
84+
args: [-c, pyproject.toml, --recursive, src]
85+
additional_dependencies: [".[toml]"] # required for pyproject.toml support

pyproject.toml

+8-25
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,15 @@ known_first_party=[
1313
'ds_pycontain'
1414
]
1515
known_third_party=[ # Most popular libraries. Extend if necessary.
16-
'IPython',
17-
'PIL',
18-
'cv2',
1916
'dotenv',
20-
'editdistance',
21-
'fastapi',
22-
'fire',
23-
'hydra',
24-
'joblib',
25-
'loguru',
26-
'luigi',
27-
'matplotlib',
28-
'neptune',
29-
'neptune_config',
30-
'nltk',
31-
'numpy',
32-
'omegaconf',
33-
'pandas',
3417
'pqdm',
3518
'pydantic',
3619
'pytest',
37-
'pytorch_lightning',
3820
'requests',
39-
'scipy',
4021
'setuptools',
41-
'shapely',
42-
'skimage',
43-
'sklearn',
44-
'streamlit',
45-
'torch',
46-
'torchvision',
4722
'tqdm',
4823
'typer',
24+
'docker',
4925
]
5026
skip_gitignore=true
5127

@@ -95,6 +71,10 @@ module = "ds_pycontain.*"
9571
ignore_missing_imports = false
9672
disallow_untyped_defs = true
9773

74+
[[tool.mypy.overrides]]
75+
module = "docker.*"
76+
ignore_errors = true
77+
9878
[tool.pylint.basic]
9979
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""""
10080
max-args=8
@@ -140,3 +120,6 @@ min-similarity-lines=10
140120

141121
[tool.bandit]
142122
exclude_dirs = ["venv",]
123+
# B101 disables errors for asserts in the code
124+
# remember to not use asserts for security and control flows
125+
skips = ["B101"]

src/ds_pycontain/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
""" ds_pycontain """
1+
""" ds_pycontain is a Python package for managing Docker containers and images. """
22
from .__version__ import __version__
3+
from .docker_containers import DockerContainer, DockerImage, generate_random_container_tag, get_docker_client
34

4-
__all__ = ["__version__"]
5+
__all__ = ["__version__", "DockerContainer", "DockerImage", "generate_random_container_tag", "get_docker_client"]

0 commit comments

Comments
 (0)