Skip to content

Commit 8e10906

Browse files
committed
Update filer and taskmaster
- Update to alpine:3.22 (python 3.12) - Update tox - Update setup.py - Fix pylint
1 parent a6e1a2a commit 8e10906

9 files changed

Lines changed: 28 additions & 38 deletions

File tree

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
12+
python-version: ['3.11', '3.12']
1313

1414
steps:
1515
- uses: actions/checkout@v3

containers/filer.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Builder: produce wheels
22

3-
FROM alpine:3.19 as builder
3+
FROM alpine:3.23 as builder
44

55
RUN apk add --no-cache python3 py3-pip
66
RUN apk add --no-cache git
7-
RUN python3 -m pip install --upgrade setuptools pip wheel --break-system-packages
7+
RUN python3 -m pip install --upgrade setuptools pip wheel build --break-system-packages
88

99
WORKDIR /app/
1010
COPY . .
1111

12-
RUN python3 setup.py bdist_wheel
12+
RUN python3 -m build --wheel && rm -rf dist/*.tar.gz
1313

1414
# Install: copy tesk-core*.whl and install it with dependencies
1515

16-
FROM alpine:3.19
16+
FROM alpine:3.23
1717

1818
RUN apk add --no-cache python3 py3-pip
1919

containers/taskmaster.Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Builder: produce wheels
22

3-
FROM alpine:3.19 as builder
3+
FROM alpine:3.23 as builder
44

55
RUN apk add --no-cache python3 py3-pip
66
RUN apk add --no-cache git
7-
RUN python3 -m pip install --upgrade setuptools pip wheel --break-system-packages
7+
RUN python3 -m pip install --upgrade setuptools pip wheel build --break-system-packages
88

99
WORKDIR /app/
1010
COPY . .
1111

12-
RUN python3 setup.py bdist_wheel
12+
RUN python3 -m build --wheel && rm -rf dist/*.tar.gz
1313

1414
# Install: copy tesk-core*.whl and install it with dependencies
1515

16-
FROM alpine:3.19
16+
FROM alpine:3.23
1717

1818
RUN apk add --no-cache python3 py3-pip
1919

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[metadata]
2-
description-file=README.md
2+
description_file=README.md
33
[aliases]
44
test=pytest

setup.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
with codecs.open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
99
LONG_DESC = f.read()
1010

11-
INSTALL_DEPS = ['kubernetes==9.0.0',
11+
INSTALL_DEPS = ['kubernetes==35.0.0',
1212
'requests>=2.20.0',
1313

14-
# urllib3 constraint
15-
'urllib3>=1.26,<2.0 ; python_version < "3.10"',
16-
'urllib3>=2.0,<3.0 ; python_version >= "3.10"',
14+
'urllib3>=2.6.0,<3.0 ; python_version >= "3.10"',
1715

18-
# boto3 constraint
19-
'boto3<=1.28 ; python_version == "3.8"',
2016
'boto3>=1.28,<2.0 ; python_version >= "3.9"',
2117
]
2218
TEST_DEPS = [ 'pytest',
@@ -56,8 +52,6 @@
5652

5753
'Intended Audience :: System Administrators',
5854

59-
'License :: OSI Approved :: Apache Software License',
60-
6155
'Programming Language :: Python :: 3',
6256
'Programming Language :: Python :: 3.7'
6357
],
@@ -74,7 +68,6 @@
7468
'taskmaster = tesk_core.taskmaster:main'
7569
]
7670
},
77-
test_suite='tests',
7871

7972
# List run-time dependencies here. These will be installed by pip when
8073
# your project is installed. For an analysis of "install_requires" vs pip's
@@ -84,8 +77,6 @@
8477

8578
setup_requires=['setuptools_scm'],
8679

87-
tests_require=TEST_DEPS,
88-
8980
python_requires='>=3.5, <4.0',
9081

9182
# List additional groups of dependencies here (e.g. development

src/tesk_core/filer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import json
88
import re
99
import os
10-
import distutils.dir_util
1110
import logging
1211
import netrc
1312
import requests
@@ -112,7 +111,7 @@ def copyFile(src, dst):
112111
'''
113112

114113
# If there is any * in 'dst', use only the dirname (base path)
115-
p = re.compile('.*\*.*')
114+
p = re.compile(r'.*\*.*')
116115
if p.match(dst):
117116
dst=os.path.dirname(dst)
118117

@@ -229,7 +228,8 @@ def download_file(self):
229228
logging.debug('Downloading ftp file: "%s" Target: %s', self.url,
230229
self.path)
231230
basedir = os.path.dirname(self.path)
232-
distutils.dir_util.mkpath(basedir)
231+
if basedir and not os.path.exists(basedir):
232+
os.makedirs(basedir, exist_ok=True)
233233

234234
return ftp_download_file(self.ftp_connection, self.url_path, self.path)
235235

src/tesk_core/filer_s3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def download_dir(self):
100100
for obj in objects["Contents"]:
101101
file_name = os.path.basename(obj["Key"])
102102
dir_name = os.path.dirname(obj["Key"])
103-
path_to_create = re.sub(r'^' + self.file_path.strip('/').replace('/', '\/') + '', "", dir_name).strip('/')
103+
path_to_create = re.sub(r'^' + self.file_path.strip('/').replace('/', r'\/') + '', "", dir_name).strip('/')
104104
path_to_create = os.path.join(self.path, path_to_create)
105105
os.makedirs(path_to_create, exist_ok=True)
106106
if self.get_s3_file(os.path.join(path_to_create, file_name), obj["Key"]):

tests/test_filer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def test_getPath(self):
190190

191191
def test_getPathNoScheme(self):
192192

193-
self.assertEquals( getPath('/home/tfga/workspace/cwl-tes/tmphrtip1o8/md5')
193+
self.assertEqual( getPath('/home/tfga/workspace/cwl-tes/tmphrtip1o8/md5')
194194
, '/home/tfga/workspace/cwl-tes/tmphrtip1o8/md5')
195195

196196
self.assertEqual( containerPath('/home/tfga/workspace/cwl-tes/tmphrtip1o8/md5')

tox.ini

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
[tox]
22
envlist =
3-
py{38,39,310,311}-unit,
4-
py{38,39,310,311}-lint
3+
py{311,312}-unit,
4+
py{311,312}-lint
55
skip_missing_interpreters = True
66

77
[gh-actions]
88
python =
9-
3.8: py38
10-
3.9: py39
11-
3.10: py310
9+
3.11: py311
10+
3.12: py312
1211

1312
[testenv]
1413
passenv = CI, TRAVIS, TRAVIS_*
1514
deps =
16-
py{38,39,310,311}: .[test]
17-
py{38,39,310,311}-unit: pytest-cov
15+
py{311,312}: .[test]
16+
py{311,312}-unit: pytest-cov
1817
codecov
19-
py{38,39,310,311}-lint: pylint
18+
py{311,312}-lint: pylint
2019
commands =
21-
py{38,39,310,311}-unit: pytest -v --cov-report xml --cov tesk_core {posargs} tests
22-
py{38,39,310,311}-unit: codecov
23-
py{38,39,310,311}-lint: python -m pylint --exit-zero -d missing-docstring,line-too-long,C tesk_core
24-
py{38,39,310,311}-lint: python -m pylint -E tesk_core
20+
py{311,312}-unit: pytest -v --cov-report xml --cov tesk_core {posargs} tests
21+
py{311,312}-unit: codecov
22+
py{311,312}-lint: python -m pylint --exit-zero -d missing-docstring,line-too-long,C tesk_core
23+
py{311,312}-lint: python -m pylint -E tesk_core

0 commit comments

Comments
 (0)