|
1 | 1 | # Python platform
|
2 | 2 |
|
3 |
| -The Python platform uses python 2.7.14 by default and get your dependencies with pip, |
4 |
| -either by ``Pipfile.lock``, ``requirements.txt`` or ``setup.py``. |
| 3 | +The Python platform uses python `3.11.3` by default and get your dependencies |
| 4 | +with pip, either by `Pipfile.lock`, `requirements.txt` or `setup.py`. |
5 | 5 |
|
6 |
| -You can define which python version you want using ``.python-version``, always use full versions. |
| 6 | +You can define which python version you want using `.python-version`, always |
| 7 | +use full versions. |
7 | 8 |
|
8 | 9 | ex:
|
9 | 10 | ```
|
10 |
| -3.6.1 |
| 11 | +3.11.3 |
11 | 12 | ```
|
12 | 13 |
|
13 |
| -available python versions: |
| 14 | +Available python versions: |
14 | 15 | - 2.7.14
|
15 |
| -- 3.5.5 |
16 |
| -- 3.6.5 |
17 |
| -- 3.7.4 |
18 |
| -- pypy2.7-5.10.0 |
19 |
| -- pypy3.5-5.10.1 |
20 |
| - |
21 |
| -when adding new releases, we will retain previous version on the series to allow time for users update their apps. |
22 |
| -e,g: when 3.6.3 is released, we will remove 3.6.1. |
| 16 | +- 3.5.10 |
| 17 | +- 3.6.15 |
| 18 | +- 3.7.16 |
| 19 | +- 3.8.16 |
| 20 | +- 3.9.16 |
| 21 | +- 3.10.11 |
| 22 | +- 3.11.3 |
| 23 | +- pypy2.7-7.3.2 |
| 24 | +- pypy3.6-7.3.2 |
| 25 | + |
| 26 | +when adding new releases, we will retain previous version on the series to |
| 27 | +allow time for users update their apps. e,g: when 3.6.3 is released, we will |
| 28 | +remove 3.6.1. |
23 | 29 |
|
24 | 30 | ## Setting pip version
|
25 | 31 |
|
26 |
| -By default, the latest pip version will be installed. If you want to use a specific version, set |
27 |
| -a ``PYTHON_PIP_VERSION`` environment variable. It accepts a specific version (``PYTHON_PIP_VERSION=7.1.2``) or a |
| 32 | +By default, the latest pip version will be installed. If you want to use a |
| 33 | +specific version, set a `PYTHON_PIP_VERSION` environment variable. It accepts |
| 34 | +a specific version (`PYTHON_PIP_VERSION=7.1.2`) or a |
28 | 35 | [requirement specifier](https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers)
|
29 |
| -(``PYTHON_PIP_VERSION="<10"``). |
| 36 | +(`PYTHON_PIP_VERSION="<10"`). |
30 | 37 |
|
31 | 38 | ## Code deployment
|
32 | 39 |
|
33 |
| -If you just run a ``tsuru app deploy`` of your code, tsuru will try |
34 |
| -to download all of your depencies using ``requirements.txt`` or ``setup script``. |
35 |
| -You can customize this behavior, see the next section for more details. |
| 40 | +If you just run a `tsuru app deploy` of your code, tsuru will try to download |
| 41 | +all of your depencies using `requirements.txt` or `setup script`. You can |
| 42 | +customize this behavior, see the next section for more details. |
36 | 43 |
|
37 | 44 | ## Code deployment with dependencies
|
38 | 45 |
|
39 |
| -There are two ways to list the applications dependencies: ``requirements.txt`` or ``setup.py``. |
40 |
| -The priority order is: requirements -> setup. The file should be in the root of deploy files. |
| 46 | +There are two ways to list the applications dependencies: `requirements.txt` |
| 47 | +or ``setup.py``. The priority order is: requirements -> setup. The file should |
| 48 | +be in the root of deploy files. |
41 | 49 |
|
42 | 50 | ### Using Pipfile.lock
|
43 | 51 |
|
44 |
| -If you have a ``Pipfile.lock`` file, tsuru will use pipenv to install the dependencies of your application. |
| 52 | +If you have a `Pipfile.lock` file, tsuru will use pipenv to install the |
| 53 | +dependencies of your application. |
45 | 54 |
|
46 | 55 | ### Using requirements.txt
|
47 | 56 |
|
48 |
| -You can define a file called ``requirements.txt`` that list all pip dependencies of your application, |
49 |
| -each line represents one dependency, here's an example: |
| 57 | +You can define a file called `requirements.txt` that list all pip |
| 58 | +dependencies of your application, each line represents one dependency, here's |
| 59 | +an example: |
50 | 60 |
|
51 |
| - $ cat requirements.txt |
52 |
| - Flask==0.10.1 |
53 |
| - gunicorn==19.3.0 |
| 61 | +$ cat requirements.txt |
| 62 | +``` |
| 63 | +Flask==0.10.1 |
| 64 | +gunicorn==19.3.0 |
| 65 | +``` |
54 | 66 |
|
55 | 67 | ### Using setup script
|
56 | 68 |
|
57 |
| -You can also define the setup script to list your dependencies, here's an example: |
58 |
| - |
59 |
| - $ cat setup.py |
60 |
| - from setuptools import setup, find_packages |
61 |
| - setup( |
62 |
| - name="app-name", |
63 |
| - packages=find_packages(), |
64 |
| - description="example", |
65 |
| - include_package_data=True, |
66 |
| - install_requires=[ |
67 |
| - "Flask==0.10.1", |
68 |
| - "gunicorn==19.3.0", |
69 |
| - ], |
70 |
| - ) |
71 |
| - |
72 |
| -After invoking ``tsuru app-deploy``, tsuru will receive your code and tell the platform |
73 |
| -to install all the dependencies using ``pipenv install --system --deploy``, ``pip install -r requirements.txt`` |
74 |
| -or ``pip instal -e ./``. |
| 69 | +You can also define the setup script to list your dependencies, here's an |
| 70 | +example: |
| 71 | + |
| 72 | +$ cat setup.py |
| 73 | +```python |
| 74 | +from setuptools import setup, find_packages |
| 75 | +setup( |
| 76 | + name="app-name", |
| 77 | + packages=find_packages(), |
| 78 | + description="example", |
| 79 | + include_package_data=True, |
| 80 | + install_requires=[ |
| 81 | + "Flask==0.10.1", |
| 82 | + "gunicorn==19.3.0", |
| 83 | + ], |
| 84 | +) |
| 85 | +``` |
| 86 | + |
| 87 | +After invoking `tsuru app-deploy`, tsuru will receive your code and tell the |
| 88 | +platform to install all the dependencies using `pipenv install --system |
| 89 | +--deploy`, `pip install -r requirements.txt` or `pip instal -e ./`. |
0 commit comments