-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: 3.9 or later features to implement #11
Comments
3.9https://www.python.org/downloads/release/python-390/
3.10Ubuntu 22.04 will install 3.10. https://www.python.org/downloads/release/python-3100/
3.11https://www.python.org/downloads/release/python-3110/
Need to upgrade:
Also:
|
Most projects have been updated to Python 3.10 (if running on the host on Ubuntu 22.04) or Python 3.11 (if running in Docker). Exceptions include credere-backend and the standard/profiles. Also, kingfisher-colab follows the Python version in Google Colaboratory. Can find others (excluding GitHub Actions workflows from packages, and PyPy) with:
Exclude these files:
|
Use https://pypi.org/project/pyupgrade/ when upgrading
3.7 and 3.8 features have been reviewed and applied to all repositories.
3.7
https://www.python.org/downloads/release/python-370/
https://docs.python.org/3.7/whatsnew/3.7.html
3.7 features
--directory
argument (e.g. update Sphinx docs instructions)sqlite3.connect
can be a path-like object (can remove)str()
in kingfisher-archiveand Metadata class in kingfisher-archive)@dataclass
initems.py
kingfisher-collect#995__init__
methods usingself\.(\S+) = \1\n +self\.(\S+) = \2\n +self\.(\S+) = \3
, but it only turned up one case (ocdskit.schema.Field
).capture_output
can replace passingsubprocess.PIPE
asstdout
andstderr
argumentsstdout
), sincecapture_output
is just sugar.pkg_resources
.pkg_resources
intest_requirements.py
, where we also use its feature of parsing requirements files.3.8
https://www.python.org/downloads/release/python-380/
https://docs.python.org/3.8/whatsnew/3.8.html
Testing
3.8 features
(\S+) = re\..+\n +if \1
and there were only 5 matches.__repr__
methods (if not already replaced by data classes from 3.7) and log messages(\S+)={\1
, but this is mostly useful for print debugging, to see the value of a variable – it shouldn't be used to e.g. construct URLs where the variable name happens to match the query string parameter@functools.cached_property
decorator can be used instead of the pattern of using private variables to cache properties, and instead of https://pypi.org/project/cached-property/@lru_cache()
can be simply@lru_cache
python -m json.tool --json-lines
in relevant OCDS documentation for data users.The text was updated successfully, but these errors were encountered: