Skip to content

Commit e8f6940

Browse files
πŸ—‘οΈ Deprecate old python versions (#157)
* update workflow before publishing python package * fix dependency issue and bump version * point to website in project description * fix broken dependency * improve doc * add github token to download artifacts * ensure only read-access @wvangeit * yet another attempt at downloading artifacts * make sure to use repo that ran the trigger wf * another attempt at fixing * change owner * allow publishing to testpypi also when pr * minor change * revert minor (but breaking) change * minor fix * add debug messages * another debug message * hopefully the final version * final fix * minor fix * move master and tag to individual jobs * add debug messages * dev->post * add python script for determining semantic version * minor changes * minor changes * improve error handling and add version file to artifacts * check if release * minor fix * ensure to enter venv * also when tagging * source venv in publishin workflow * ensure only master * add script for testing 'pure' semver * adapt workflows to new python script * minor change * attempt to evaluate expressions correctly * several fixes to fix tests * ensure repo is checked out in publish workflow * several small fixes * cleanup * debug * minor cleanup * mionr changes * add debug message * minor change * minor change * yet another try * minor change * minor change * minor change * mionr change * minor changes * correct workflow run id * cosmetic change * avoid using gh * change to a single job for publishing * minor cleanup * swap loops in clean up jobs * correction * update server compatibility to new url * minor change to trigger ci * update deprecation warnings * ensure it works * remove constraint on papermill version * add icon * correct readme * update readme * @pcrespov raise exception if retired python version
1 parent 4b9757f commit e8f6940

File tree

6 files changed

+44
-5
lines changed

6 files changed

+44
-5
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ See the different `clients/<language>/README.md` for the workflows for generatin
2626
1. The openapi specification which is a json file located in `api/openapi.json`. This generated in [osparc-simcore](https://github.com/ITISFoundation/osparc-simcore/tree/master/services/api-server) and then moved here.
2727
2. The [openapi-generator](https://github.com/ITISFoundation/openapi-generator)-tool. The exact docker image of this tool to use is specifies in `scripts/common.Makefile`.
2828

29+
## Code lifecycle
30+
This link explains the lifecycle of the osparc client(s) (borrowed from https://www.ibm.com/docs/en/acvfc?topic=manager-product-lifecycle)
31+
<p align="center">
32+
<a href="https://www.ibm.com/docs/en/acvfc?topic=manager-product-lifecycle" target="_blank">
33+
<image src="https://github.com/ITISFoundation/osparc-simcore-clients/blob/master/docs/_media/code_lifecycle.png?raw=true" alt="Code lifecycle" width="20%" />
34+
</a>
35+
</p>
36+
2937

3038
## Documentation
3139

@@ -37,3 +45,9 @@ Here is an inexhaustive list which have this repo as a dependency. So changing s
3745

3846
- [e2e-portal-testing](https://git.speag.com/oSparc/e2e-portal-testing/-/commit/950762bde1a60c7ce23286da9c100150ed6926e4)
3947
- [osparc-simcore](https://github.com/ITISFoundation/osparc-simcore/actions/runs/5319311892/jobs/9631979977)
48+
49+
<p align="center">
50+
<a href="https://www.z43.swiss" target="_blank">
51+
<image src="https://github.com/ITISFoundation/osparc-simcore-clients/blob/master/docs/_media/mwl.png?raw=true" alt="Made with love (and lots of hard work) at www.z43.swiss" width="20%" />
52+
</a>
53+
</p>

β€Žclients/python/client/osparc/__init__.pyβ€Ž

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import warnings
2+
from platform import python_version
13
from typing import List, Tuple
24

35
import nest_asyncio
@@ -34,14 +36,35 @@
3436
ValidationError,
3537
__version__,
3638
)
39+
from packaging.version import Version
3740

38-
from ._exceptions import RequestError
41+
from ._exceptions import RequestError, VisibleDeprecationWarning
3942
from ._files_api import FilesApi
4043
from ._info import openapi
4144
from ._solvers_api import SolversApi
4245
from ._studies_api import StudiesApi
4346
from ._utils import dev_features_enabled
4447

48+
_PYTHON_VERSION_DEPRECATED = Version("3.6.0")
49+
_PYTHON_VERSION_SUPPORTED = Version("3.8.0")
50+
51+
if Version(python_version()) < _PYTHON_VERSION_DEPRECATED:
52+
error_msg: str = (
53+
f"Python version {python_version()} is retired for this version of osparc. "
54+
f"Please use Python version {_PYTHON_VERSION_SUPPORTED}."
55+
)
56+
raise RuntimeError(error_msg)
57+
58+
if Version(python_version()) < _PYTHON_VERSION_SUPPORTED:
59+
warning_msg: str = (
60+
"This is the final version of osparc which "
61+
f"will support Python {python_version()}. "
62+
"Future versions of osparc will only support "
63+
f"Python version >= {_PYTHON_VERSION_SUPPORTED}."
64+
)
65+
warnings.warn(warning_msg, VisibleDeprecationWarning)
66+
67+
4568
nest_asyncio.apply() # allow to run coroutines via asyncio.run(coro)
4669

4770
dev_features: List[str] = []

β€Žclients/python/client/osparc/models.pyβ€Ž

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import warnings
2-
from typing import Final, Tuple
2+
from typing import Tuple
33

44
from osparc_client.models import (
55
BodyUploadFileV0FilesContentPut,
@@ -19,10 +19,11 @@
1919

2020
from ._exceptions import VisibleDeprecationWarning
2121

22-
warning_msg: Final[str] = (
22+
warning_msg: str = (
2323
"osparc.models has been deprecated. Instead functionality within this module "
2424
"should be imported directly from osparc. I.e. please do 'from osparc import "
25-
"<fcn>' instead of 'from osparc.models import <fcn>'"
25+
"<fcn>' instead of 'from osparc.models import <fcn>'. "
26+
"Future version of osparc will not allow import of osparc.models."
2627
)
2728
warnings.warn(warning_msg, VisibleDeprecationWarning)
2829

β€Žclients/python/client/setup.pyβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"tqdm>=4.48.0",
2121
"nest_asyncio",
2222
"tenacity",
23+
"packaging",
2324
]
2425

2526
setup(

β€Žclients/python/requirements/e2e-test.txtβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jinja2
77
matplotlib
88
packaging
99
pandas
10-
papermill<2.5.0 # due to bug in 2.5.0 (https://github.com/nteract/papermill/issues/735). Remove this requirement once the bug is fixed
10+
papermill
1111
pydantic
1212
pytest
1313
pytest-asyncio
56.5 KB
Loading

0 commit comments

Comments
Β (0)