Skip to content

Commit

Permalink
build(python): drop support for Python 3.6 and 3.7 (reanahub#715)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop support for Python 3.6 and 3.7

Closes reanahub/reana#784
  • Loading branch information
mdonadoni committed Mar 26, 2024
1 parent 3465eb0 commit a2eddc8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ jobs:
strategy:
matrix:
testenv: [lowest, release]
python: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
python-version: ${{ matrix.python-version }}

- name: Setup requirements builder
run: |
Expand Down
10 changes: 3 additions & 7 deletions reana_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,22 +139,18 @@ def get_workflow_duration(workflow: Dict) -> Optional[int]:
time is not present.
"""

# FIXME: Use datetime.fromisoformat when moving to Python 3.7 or higher
def fromisoformat(date_string):
return datetime.strptime(date_string, "%Y-%m-%dT%H:%M:%S")

progress = workflow.get("progress", {})
run_started_at = progress.get("run_started_at")
run_finished_at = progress.get("run_finished_at")
run_stopped_at = progress.get("run_stopped_at")

duration = None
if run_started_at:
start_time = fromisoformat(run_started_at)
start_time = datetime.fromisoformat(run_started_at)
if run_finished_at:
end_time = fromisoformat(run_finished_at)
end_time = datetime.fromisoformat(run_finished_at)
elif run_stopped_at:
end_time = fromisoformat(run_stopped_at)
end_time = datetime.fromisoformat(run_stopped_at)
else:
end_time = datetime.utcnow()
duration = round((end_time - start_time).total_seconds())
Expand Down
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"tablib>=0.12.1,<0.13",
"werkzeug>=0.14.1 ; python_version<'3.10'",
"werkzeug>=0.15.0 ; python_version>='3.10'",
"swagger_spec_validator>=2.4.0,<3.0.0; python_version<'3.7'",
]

packages = find_packages()
Expand Down Expand Up @@ -82,7 +81,7 @@
"reana-cwl-runner = reana_client.cli.cwl_runner:cwl_runner",
],
},
python_requires=">=3.6",
python_requires=">=3.8",
extras_require=extras_require,
install_requires=install_requires,
setup_requires=setup_requires,
Expand All @@ -94,8 +93,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down

0 comments on commit a2eddc8

Please sign in to comment.