Skip to content

Commit b1096d5

Browse files
committed
Adjustments on translations
1 parent 3834bdf commit b1096d5

File tree

4 files changed

+277
-289
lines changed

4 files changed

+277
-289
lines changed

docs/lessons/05-python-packaging/index.md

Lines changed: 36 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ To add packages that are automatically installed when we install our package we
6464
~~~
6565
...
6666
install_requires=[
67-
'packaage1>=1.0',
67+
'package1>=1.0',
6868
'package2'
6969
],
7070
...
@@ -75,100 +75,96 @@ To add packages that are automatically installed when we install our package we
7575
Check the code dependencies and add them to `setup.py`...
7676

7777
### requirements.txt
78-
79-
Muitos softwares usam também um arquivo *requirements.txt* para listar **todas** as dependências do software de modo a obter uma instalação idêntica à do desenvolvedor. Isto é importante para uniformizar os ambientes de desenvolvimento. Ou seja, este arquivo nunca será usado por usuários finais.
78+
8079
Many software also use a *requirements.txt* file to list **all** software dependencies in order to obtain a installation identical to that of developer. This is important to standardize development environments. This file will never be used by end users.
8180

8281
!!! exercise
8382
Create a *requirements.txt* file for your project with the same dependencies listed on your *setup.py*.
8483

8584
### Runnable Scripts
8685

87-
Além de instalar o nosso módulo para uso via `import` desejamos também disponibilizar o arquivo *hello.py* como um executável para todo o sistema. Isto pode ser feito adicionando a seguinte linha no nosso *setup.py* indicando que *scripts/hello.py* deverá ser instalado como um executável.
88-
89-
In addition to installing our module for use *via* `import`, we also want to make *hello.py* file available as an executable for entire system. This can be done by adding the following line to our *setup.py* indicating that *scripts/hello.py* should be installed as an executable.
86+
In addition to install our module for using `import`, we also want to make *hello.py* file available as an executable file for entire system. This can be done by adding the following line to our *setup.py* indicating that *scripts/hello.py* should be installed as an executable.
9087

9188
~~~
9289
...
9390
scripts=['scripts/hello.py'],
9491
...
9592
~~~
9693
97-
Não se esqueça de adicionar a seguinte linha no topo de seu arquivo para que ele possa ser executado diretamente do shell:
94+
Don't forget to add the following line to the top of your file so it can be run directly from shell:
9895

9996
~~~
10097
#!/usr/bin/env python3
10198
~~~
10299

103-
No Windows é criado um executável que chama nosso script, de modo que as chamadas do executável continuarão funcionando normalmente. Note que isto não cria menus em nenhum tipo de interface gráfica.
100+
On Windows, an executable is created that runs our script, so that executable calls will work normally. Note that this does not create any type of graphical interface.
104101

105-
### Criando arquivos de distribuição
102+
### Creating distribution files
106103

107-
Dois tipos de arquivos de distribuição podem ser usados:
104+
Two types of distribution files can be used:
108105

109-
- sdist: é um arquivo contendo os fontes do projeto, incluindo arquivos adicionais especificados usando o argumento `data_files`. Usado se seu projeto for Python-puro.
110-
- wheel: é um formato pré-compilado e específico para cada plataforma. Mais usado quando o projeto contém extensões em *C*.
106+
- **sdist**: This file contains project's source code, including additional files specified by using `data_files` argument. This is used if your project is pure Python (only written in Python).
107+
- **wheel**: This is a precompiled, platform-specific format. Most commonly used when the project contains *C language* extensions.
111108

112-
A criação de um arquivo de distribuição de fontes é bem simples:
109+
Creating a source code distribution file is quite simple:
113110

114111
<ah-terminal>
115-
$ python setup.py sdist
112+
$ python setup.py sdist
116113
</ah-terminal>
117-
118-
A instalação deste pacote pode ser feita via `pip`.
119114

120-
### Envio para o PyPI
115+
This package can be installed by `pip`.
121116

122-
Vamos agora enviar nosso pacote para o *Python Package Index* para que ele possa ser instalado diretamente via `pip`. Para não poluir o repositório com pacotes temporários e de teste, podemos usar o *TestPyPI*. Toda sua infraestrutura é igual ao oficial, mas ele é limpo de maneira regular.
117+
### Uploading to PyPI
123118

124-
Visite [https://test.pypi.org/account/register/](https://test.pypi.org/account/register/) e registre-se no *TestPyPI*.
119+
Now let's upload our package to *Python Package Index*; so it can be installed directly by `pip`. To avoid cluttering the repository with temporary and test packages, we can use *TestPyPI*. Its entire infrastructure is the same as the official one, but it is cleaned regularly.
125120

126-
Após o registro, usaremos o pacote *twine* (instalável via *pip*) para fazer o upload:
121+
Visit [https://test.pypi.org/account/register/](https://test.pypi.org/account/register/) and register yourself on *TestPyPI*.
127122

123+
After registration, we'll use the *twine* package (installable by *pip*) to upload:
128124

129125
<ah-terminal>
130126
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
131127
</ah-terminal>
132128

133-
Você poderá, então, instalar seu pacote a partir do test PyPI usando o seguinte comando:
129+
You can then install your package from *TestPyPI* using the following command:
134130

135131
<ah-terminal>
136-
$ pip install --index-url https://test.pypi.org/simple/ my_hello_nome
132+
$ pip install --index-url https://test.pypi.org/simple/ my_hello_pack
137133
</ah-terminal>
138134

139-
### Entrega
135+
### Submit your assignment
140136

141-
Faça a entrega de sua atividade adicionando a skill *Pacote Python* e inclua nela a url do seu repositório no github.
137+
Submit your assignment by adding *Python Package* skill and including URL of your GitHub repository.
142138

143-
![Skill Pacote Python](skill-python.svg){ style="height:150px" }
139+
![Python Package Skill](skill-python.svg){ style="height:150px" }
144140

145-
**Objetivo**: Primeira experiência distribuindo software Python.
141+
**Objective**: First experience distributing Python software.
146142

147-
> "skill_id": 6, "metadata": {"url": "repo-seu-pacote"}
143+
> "skill_id": 6, "metadata": {"url": "repo-your-package"}
148144
149-
## Distribuindo software para usuários finais
145+
## Distributing Software to End Users
150146

151-
Vamos agora trabalhar (em duplas) no Servidor de Desafios novamente. Seu trabalho será criar um `Dockerfile` que roda o software de maneira "completa". Ou seja, o script de criação do container deverá
147+
Now we'll work (in pairs) on the *Challenge Server* again. Your job will be to create a Dockerfile that runs this software *completely*. In other words, container creation script must:
152148

153-
- [ ] instalar todas as dependências do sistema
154-
- [ ] criar a base de dados, se necessário
155-
- [ ] adicionar os usuários presentes no arquivo `users.csv`, se necessário
156-
- [ ] executar o servidor e serví-lo na porta `8080` do `host`
157-
- [ ] manter os dados adicionados ao reiniciar o container
149+
- [ ] install all system dependencies
150+
- [ ] create database, if it is necessary
151+
- [ ] add all users present in `users.csv` file, if it is necessary
152+
- [ ] run server on host port `8080`
153+
- [ ] retain added data when restarting the container
158154

159-
### Entrega
155+
### Deliver this assignment
160156

161-
Faça a entrega de sua atividade adicionando a skill *Dockerfile* segundo o modelo abaixo.
157+
Deliver your activity by adding skill *Dockerfile* according to template below:
162158

163159
![Skill Dockerfile](skill-docker.svg){ style="height:150px" }
164160

165-
**Objetivo**: Criou deploy automatizado para sistema web Python
161+
**Objective**: Create an automated deployment for a Python web system
166162

167-
> "skill_id": 7, "metadata": {"url": "repo-servidor-de-desafios", "group": ["login1", "login2"]}
163+
> "skill_id": 7, "metadata": {"url": "challenge-server-repo", "group": ["login1", "login2"]}
168164
169-
### Referências
165+
### References
170166

171-
Algumas referências que podem ser úteis:
167+
Some references that may be useful:
172168

173169
* [https://docker-curriculum.com/](https://docker-curriculum.com/)
174170
* [https://docs.docker.com/get-started/](https://docs.docker.com/get-started/)

0 commit comments

Comments
 (0)