Skip to content

Commit f7027bc

Browse files
authored
Updating python README (#124)
1 parent eed4247 commit f7027bc

File tree

1 file changed

+60
-45
lines changed

1 file changed

+60
-45
lines changed

python/README.md

+60-45
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,89 @@
11
# Python platform
22

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`.
55

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.
78

89
ex:
910
```
10-
3.6.1
11+
3.11.3
1112
```
1213

13-
available python versions:
14+
Available python versions:
1415
- 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.
2329

2430
## Setting pip version
2531

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
2835
[requirement specifier](https://pip.pypa.io/en/stable/reference/pip_install/#requirement-specifiers)
29-
(``PYTHON_PIP_VERSION="<10"``).
36+
(`PYTHON_PIP_VERSION="<10"`).
3037

3138
## Code deployment
3239

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.
3643

3744
## Code deployment with dependencies
3845

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.
4149

4250
### Using Pipfile.lock
4351

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.
4554

4655
### Using requirements.txt
4756

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:
5060

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+
```
5466

5567
### Using setup script
5668

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

Comments
 (0)