Skip to content

Commit

Permalink
Merge pull request #64 from Yelp/u/smatthew/python3
Browse files Browse the repository at this point in the history
Attempt to build using Python 3
  • Loading branch information
jvperrin authored Jul 1, 2022
2 parents 80b7c01 + 7557ecc commit 1914c1b
Show file tree
Hide file tree
Showing 11 changed files with 149 additions and 31 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ jobs:
fail-fast: false
matrix:
include:
- python-version: 2.7
toxenv: py27
- python-version: 3.6
toxenv: py36
- python-version: 3.7
toxenv: py37
- python-version: 3.8
Expand Down
20 changes: 15 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
repos:
- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v2.2.1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-builtin-literals
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-vcs-permalinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
exclude: CHANGELOG.md
- id: flake8
- id: name-tests-test
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: git://github.com/Yelp/detect-secrets
rev: v0.12.2
- repo: https://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
args: ['--max-line-length=130']
- repo: https://github.com/Yelp/detect-secrets
rev: v1.2.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
Expand Down
107 changes: 97 additions & 10 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,22 +1,109 @@
{
"exclude": {
"files": "tests/.*",
"lines": null
},
"generated_at": "2019-04-24T14:36:38Z",
"version": "1.2.0",
"plugins_used": [
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
"name": "ArtifactoryDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"version": "0.12.2"
"generated_at": "2022-06-28T02:48:44Z"
}
14 changes: 14 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
docker-custodian (0.8.1) bionic; urgency=medium

* Drop python 3.6 support
* Upgrade pre-commit hooks
* Use python 3.7 on Jammy (22.04) too

-- Jason Perrin <[email protected]> Tue, 28 Jun 2022 17:02:02 -0700

docker-custodian (0.8.0) xenial; urgency=medium

* Build for Python 3

-- Sophie Matthews <[email protected]> Tue, 26 Apr 2022 16:57:00 +0100

docker-custodian (0.7.3) lucid; urgency=medium

* Fix handling containers with null labels
Expand Down
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7
10
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Source: docker-custodian
Maintainer: Daniel Nephin <[email protected]>
Build-Depends:
dh-virtualenv,
dh-virtualenv, python3 (>= 3.7) | python3.7

Depends: python2.7
Depends: ${pythonRuntime:Depends}
Package: docker-custodian
Architecture: any
Description: Remove old Docker containers and images that are no longer in use
13 changes: 12 additions & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@

export DH_OPTIONS

ifeq ($(shell (. /etc/lsb-release && dpkg --compare-versions $$DISTRIB_RELEASE ge "22.04" && echo yes || echo no)),yes)
python3_depends = python3.7, python3.7-distutils
python3_runtime = python3.7
else
python3_depends = python3.7
python3_runtime = python3.7
endif

%:
dh $@ --with python-virtualenv

override_dh_gencontrol:
dh_gencontrol -- -VpythonRuntime:Depends="$(python3_depends)"

override_dh_virtualenv:
dh_virtualenv --python python2.7
dh_virtualenv --python $(python3_runtime) --extra-pip-arg --only-binary=:all:

# do not call `make clean` as part of packaging
override_dh_auto_clean:
Expand Down
2 changes: 1 addition & 1 deletion docker_custodian/__about__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf8 -*-

__version_info__ = (0, 7, 4)
__version_info__ = (0, 8, 1)
__version__ = '%d.%d.%d' % __version_info__
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
backports.ssl-match-hostname==3.5.0.1
callee==0.3.1
certifi==2018.1.18
chardet==3.0.4
docker==3.1.0
docker==5.0.3
docker-pycreds==0.2.2
future==0.16.0
idna==2.6
ipaddress==1.0.19
python-dateutil==2.6.1
pytimeparse==1.1.7
pytimeparse==1.1.8
requests==2.20.0
six==1.11.0
urllib3==1.24.2
websocket-client==0.47.0
websocket-client==0.57.0
5 changes: 2 additions & 3 deletions tests/docker_gc_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from callee import String, Regex
from six import StringIO
import textwrap

Expand Down Expand Up @@ -406,9 +407,7 @@ def test_api_call_with_api_error():
docker_gc.api_call(func, image=image)

func.assert_called_once_with(image="abcd")
mock_log.warn.assert_called_once_with(
'Error calling remove_image image=abcd '
'409 Client Error: Conflict ("failed")')
mock_log.warn.assert_called_once_with(String() & Regex('Error calling remove_image image=abcd 409 Client Error .*'))


def days_as_seconds(num):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py36,py37,py38,py39
envlist = py37,py38,py39

[testenv]
deps =
Expand Down

0 comments on commit 1914c1b

Please sign in to comment.