Updated refrences to Python 3.10 --> 3.11. (#3384)
This commit is contained in:
@@ -20,13 +20,14 @@ Code can be written and executed from the command line, in an interactive interp
|
||||
The [zen of Python (PEP 20)][the zen of python] and [What is Pythonic?][what is pythonic] lay out additional philosophies and perspectives on the language.
|
||||
|
||||
|
||||
This track currently uses `Python 3.9.0`.
|
||||
Tests and tooling for this track currently support `3.7` - `3.10.6` (_tests_) and [`Python 3.11`][311-new-features] (_tooling_).
|
||||
It is highly recommended that students upgrade to at least `Python 3.8`, as some features used by this track may not be supported in earlier versions.
|
||||
That being said, most exercises can be completed using Python 3.7, and many can be worked in Python 3.6.
|
||||
We will note when a feature is only available in a certain version.
|
||||
That being said, most of the exercises will work with `Python 3.6+`, and many are compatible with `Python 2.7+`.
|
||||
But we don't guarantee support for versions not listed under [Active Python Releases][active-python-releases].
|
||||
We will try to note when a feature is only available in a certain version.
|
||||
|
||||
|
||||
Complete documentation for the current release of Python (3.9.7) can be found at [docs.python.org][python docs].
|
||||
Complete documentation for the current release of Python (3.11.2) can be found at [docs.python.org][python docs].
|
||||
|
||||
- [Python Tutorial][python tutorial]
|
||||
- [Python Library Reference][python library reference]
|
||||
@@ -36,6 +37,9 @@ Complete documentation for the current release of Python (3.9.7) can be found at
|
||||
- [Python Glossary of Terms][python glossary of terms]
|
||||
|
||||
|
||||
|
||||
[311-new-features]: https://docs.python.org/3/whatsnew/3.11.html
|
||||
[active-python-releases]: https://www.python.org/downloads/
|
||||
[duck typing]: https://en.wikipedia.org/wiki/Duck_typing
|
||||
[dynamic typing in python]: https://stackoverflow.com/questions/11328920/is-python-strongly-typed
|
||||
[editors for python]: https://djangostars.com/blog/python-ide/
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# Exercism Python Track Test Generator
|
||||
|
||||
The Python track uses a generator script and [Jinja2] templates for
|
||||
creating test files from the canonical data.
|
||||
The Python track uses a generator script and [Jinja2][Jinja2] templates for
|
||||
creating test files from Exercism's [canonical data][canonical data].
|
||||
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -15,14 +16,16 @@ creating test files from the canonical data.
|
||||
* [Learning Jinja](#learning-jinja)
|
||||
* [Creating a templates](#creating-a-templates)
|
||||
|
||||
|
||||
## Script Usage
|
||||
|
||||
Test generation requires a local copy of the [problem-specifications] repository.
|
||||
Test generation requires a local copy of the [problem-specifications][problem-specifications] repository.
|
||||
The script should be run from the root `python` directory, in order to correctly
|
||||
access the exercises.
|
||||
|
||||
Run `bin/generate_tests.py --help` for usage information.
|
||||
|
||||
|
||||
## Test Templates
|
||||
|
||||
Test templates support [Jinja2] syntax, and have the following context
|
||||
@@ -42,6 +45,7 @@ Additionally, the following template filters are added for convenience:
|
||||
- `error_case`: Checks if a test case expects an error to be thrown (ex: `{% for case in cases%}{% if case is error_case}`)
|
||||
- `regex_replace`: Regex string replacement (ex: `{{ "abc123" | regex_replace("\\d", "D") }}` -> `abcDDD`)
|
||||
|
||||
|
||||
### Conventions
|
||||
|
||||
- General-use macros for highly repeated template structures are defined in `config/generator_macros.j2`.
|
||||
@@ -63,6 +67,7 @@ files.
|
||||
# Additional tests for this track
|
||||
```
|
||||
|
||||
|
||||
### Layout
|
||||
|
||||
Most templates will look something like this:
|
||||
@@ -83,6 +88,7 @@ class {{ exercise | camel_case }}Test(unittest.TestCase):
|
||||
{{ macros.footer() }}
|
||||
```
|
||||
|
||||
|
||||
### Overriding Imports
|
||||
|
||||
The names imported in `macros.header()` may be overridden by adding
|
||||
@@ -92,6 +98,7 @@ a list of alternate names to import (ex:`clock`):
|
||||
{{ macros.header(["Clock"])}}
|
||||
```
|
||||
|
||||
|
||||
### Ignoring Properties
|
||||
|
||||
On rare occasion, it may be necessary to filter out properties that
|
||||
@@ -102,6 +109,7 @@ are not tested in this track. The `header` macro also accepts an
|
||||
{{ macros.header(ignore=["scores"]) }}
|
||||
```
|
||||
|
||||
|
||||
## Learning Jinja
|
||||
|
||||
Starting with the [Jinja Documentation] is highly recommended, but a complete reading is not strictly necessary.
|
||||
@@ -127,8 +135,9 @@ Additional Resources:
|
||||
|
||||
|
||||
|
||||
[Jinja Documentation]: https://jinja.palletsprojects.com/en/3.1.x/
|
||||
[Jinja2]: https://palletsprojects.com/p/jinja/
|
||||
[Jinja Documentation]: https://jinja.palletsprojects.com/en/2.10.x/
|
||||
[Primer on Jinja Templating]: https://realpython.com/primer-on-jinja-templating/
|
||||
[Python Jinja tutorial]: http://zetcode.com/python/jinja/
|
||||
[canonical data]: https://github.com/exercism/problem-specifications/tree/main/exercises
|
||||
[problem-specifications]: https://github.com/exercism/problem-specifications
|
||||
|
||||
@@ -7,7 +7,7 @@ Finally, these posts by Brett Cannon [A quick-and-dirty guide][quick-and-dirty]
|
||||
|
||||
**Note for MacOS users:** prior to MacOS Monterey (12.3), `Python 2.7` came pre-installed with the operating system.
|
||||
Using `Python 2.7` with Exercism or most other programs is not recommended.
|
||||
You should instead install Python 3 via one of the methods detailed below.
|
||||
You should instead install [Python 3][Python-three downloads] via one of the methods detailed below.
|
||||
As of MacOS Monterey (12.3), no version of Python will be pre-installed via MacOS.
|
||||
|
||||
Some quick links into the documentation by operating system:
|
||||
@@ -18,12 +18,18 @@ Some quick links into the documentation by operating system:
|
||||
We recommend reviewing some of the methods outlined in the Real Python article [Installing Python][installing-python] or the articles by Brett Cannon linked above.
|
||||
|
||||
|
||||
Exercism tests and tooling currently support `Python 3.8` (_tests_) and `Python 3.9` (_tooling_).
|
||||
This means that the [newest features of Python `3.10`][310-new-features] are **not** currently supported.
|
||||
Please refer to the [Python 3.9.x documentation][3.9 docs] for what is currently supported.
|
||||
Exercism tests and tooling currently support `3.7` - `3.10.6` (_tests_) and [`Python 3.11`][311-new-features] (_tooling_).
|
||||
Exceptions to this support are noted where they occur.
|
||||
Most of the exercises will work with `Python 3.6+`, and many are compatible with `Python 2.7+`.
|
||||
But we don't guarantee support for versions not listed under [Active Python Releases][active-python-releases].
|
||||
|
||||
[3.9 docs]: https://docs.python.org/3.9/
|
||||
[310-new-features]: https://docs.python.org/3/whatsnew/3.10.html
|
||||
|
||||
Please refer to the [Python 3.11.x documentation][3.11 docs] for what is currently supported.
|
||||
|
||||
[3.11 docs]: https://docs.python.org/3.11/
|
||||
[311-new-features]: https://docs.python.org/3/whatsnew/3.11.html
|
||||
[Python-three downloads]: https://www.python.org/downloads/
|
||||
[active-python-releases]: https://www.python.org/downloads/
|
||||
[helpful guide]: https://realpython.com/installing-python/
|
||||
[installing-python]: https://realpython.com/installing-python/#what-your-options-are_1
|
||||
[macos]: https://docs.python.org/3/using/mac.html
|
||||
|
||||
@@ -21,12 +21,13 @@ Below you will find some additional jumping-off places to start your learning jo
|
||||
- [Think Python][Think Python]
|
||||
- [Python for Non-Programmers][python-for-non-programmers]
|
||||
- [Python 4 Everyone][python4everyone]
|
||||
- [Introduction to Computer Science and Programming in Python (MIT)][mitocw600]
|
||||
- [Googles Python Class][googles python class]
|
||||
- [Microsoft's Python Learning Path][MS Python]
|
||||
- [PyCharm EDU **IDE** and **Courses**][pycharm edu] (_paid_)
|
||||
- [Introduction to Computer Science and Programming in Python (MIT)][mitocw600]
|
||||
- [Harvard CS50P][CS50P]
|
||||
|
||||
|
||||
[CS50P]: https://pll.harvard.edu/course/cs50s-introduction-programming-python?delta=0
|
||||
[Learn X in Y minutes]: https://learnxinyminutes.com/docs/python3/
|
||||
[MS Python]: https://docs.microsoft.com/en-us/learn/paths/python-language/
|
||||
[Python Documentation Tutorial]: https://docs.python.org/3/tutorial/index.html
|
||||
|
||||
@@ -272,5 +272,5 @@ export PATH=”$PATH:{python_directory}}”
|
||||
[python command line]: https://docs.python.org/3/using/cmdline.html
|
||||
[python-m-pip]: https://snarky.ca/why-you-should-use-python-m-pip/
|
||||
[quick-and-dirty]: https://snarky.ca/a-quick-and-dirty-guide-on-how-to-install-packages-for-python/
|
||||
[tutorial from pycqa.org]: https://pylint.pycqa.org/en/latest/tutorial.html
|
||||
[tutorial from pycqa.org]: https://pylint.pycqa.org/en/v2.17.2/tutorial.html
|
||||
[working with custom markers]: https://docs.pytest.org/en/6.2.x/example/markers.html#working-with-custom-markers
|
||||
|
||||
Reference in New Issue
Block a user