Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions containers/filer.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Builder: produce wheels

FROM alpine:3.19 as builder
FROM alpine:3.23 as builder

RUN apk add --no-cache python3 py3-pip
RUN apk add --no-cache git
RUN python3 -m pip install --upgrade setuptools pip wheel --break-system-packages
RUN python3 -m pip install --upgrade setuptools pip wheel build --break-system-packages

WORKDIR /app/
COPY . .

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

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

FROM alpine:3.19
FROM alpine:3.23

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

Expand Down
8 changes: 4 additions & 4 deletions containers/taskmaster.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# Builder: produce wheels

FROM alpine:3.19 as builder
FROM alpine:3.23 as builder

RUN apk add --no-cache python3 py3-pip
RUN apk add --no-cache git
RUN python3 -m pip install --upgrade setuptools pip wheel --break-system-packages
RUN python3 -m pip install --upgrade setuptools pip wheel build --break-system-packages

WORKDIR /app/
COPY . .

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

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

FROM alpine:3.19
FROM alpine:3.23

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

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[metadata]
description-file=README.md
description_file=README.md
[aliases]
test=pytest
13 changes: 2 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
with codecs.open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
LONG_DESC = f.read()

INSTALL_DEPS = ['kubernetes==9.0.0',
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
INSTALL_DEPS = ['kubernetes==35.0.0',
'requests>=2.20.0',

# urllib3 constraint
'urllib3>=1.26,<2.0 ; python_version < "3.10"',
'urllib3>=2.0,<3.0 ; python_version >= "3.10"',
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
'urllib3>=2.6.0,<3.0 ; python_version >= "3.10"',

# boto3 constraint
'boto3<=1.28 ; python_version == "3.8"',
'boto3>=1.28,<2.0 ; python_version >= "3.9"',
]
TEST_DEPS = [ 'pytest',
Expand Down Expand Up @@ -56,8 +52,6 @@

Comment thread
sourcery-ai[bot] marked this conversation as resolved.
'Intended Audience :: System Administrators',

'License :: OSI Approved :: Apache Software License',

'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7'
],
Expand All @@ -74,7 +68,6 @@
'taskmaster = tesk_core.taskmaster:main'
]
},
test_suite='tests',

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

setup_requires=['setuptools_scm'],

tests_require=TEST_DEPS,

python_requires='>=3.5, <4.0',

# List additional groups of dependencies here (e.g. development
Expand Down
6 changes: 3 additions & 3 deletions src/tesk_core/filer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import json
import re
import os
import distutils.dir_util
import logging
import netrc
import requests
Expand Down Expand Up @@ -112,7 +111,7 @@ def copyFile(src, dst):
'''

# If there is any * in 'dst', use only the dirname (base path)
p = re.compile('.*\*.*')
p = re.compile(r'.*\*.*')
if p.match(dst):
dst=os.path.dirname(dst)

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/tesk_core/filer_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def download_dir(self):
for obj in objects["Contents"]:
file_name = os.path.basename(obj["Key"])
dir_name = os.path.dirname(obj["Key"])
path_to_create = re.sub(r'^' + self.file_path.strip('/').replace('/', '\/') + '', "", dir_name).strip('/')
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
path_to_create = re.sub(r'^' + self.file_path.strip('/').replace('/', r'\/') + '', "", dir_name).strip('/')
path_to_create = os.path.join(self.path, path_to_create)
os.makedirs(path_to_create, exist_ok=True)
if self.get_s3_file(os.path.join(path_to_create, file_name), obj["Key"]):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_filer.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def test_getPath(self):

def test_getPathNoScheme(self):

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

self.assertEqual( containerPath('/home/tfga/workspace/cwl-tes/tmphrtip1o8/md5')
Expand Down
23 changes: 11 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
[tox]
envlist =
py{38,39,310,311}-unit,
py{38,39,310,311}-lint
py{311,312}-unit,
py{311,312}-lint
skip_missing_interpreters = True

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
passenv = CI, TRAVIS, TRAVIS_*
deps =
py{38,39,310,311}: .[test]
py{38,39,310,311}-unit: pytest-cov
py{311,312}: .[test]
py{311,312}-unit: pytest-cov
codecov
py{38,39,310,311}-lint: pylint
py{311,312}-lint: pylint
commands =
py{38,39,310,311}-unit: pytest -v --cov-report xml --cov tesk_core {posargs} tests
py{38,39,310,311}-unit: codecov
py{38,39,310,311}-lint: python -m pylint --exit-zero -d missing-docstring,line-too-long,C tesk_core
py{38,39,310,311}-lint: python -m pylint -E tesk_core
py{311,312}-unit: pytest -v --cov-report xml --cov tesk_core {posargs} tests
py{311,312}-unit: codecov
py{311,312}-lint: python -m pylint --exit-zero -d missing-docstring,line-too-long,C tesk_core
py{311,312}-lint: python -m pylint -E tesk_core