Skip to content

Commit 1e47be5

Browse files
committed
minor change
1 parent a9c61be commit 1e47be5

File tree

3 files changed

+32
-29
lines changed

3 files changed

+32
-29
lines changed

docs/lessons/03-software-documentation/slides_cedm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<h1 id="open-development">Open Development</h1>
1313
<p><img src="capa.svg" alt="" style="width:300px;" /></p>
1414
<h5 id="software-documentation">Software Documentation</h5>
15-
<h6 id="vers%C3%A3o-20252---carlos-menezes-carlosedminsperedubr">Versão 2025/2 - Carlos Menezes (<a href="mailto:[email protected]">[email protected]</a>)</h6>
15+
<h6 id="edition-20252---carlos-menezes-carlosedminsperedubr">Edition 2025/2 - Carlos Menezes (<a href="mailto:[email protected]">[email protected]</a>)</h6>
1616
<footer>Carlos Menezes <img src="../cc-by-nc-sa.png" alt="License CC BY-NC-SA 4.0" /></footer>
1717
</section>
1818
</foreignObject></svg><svg data-marpit-svg="" viewBox="0 0 1280 720"><foreignObject width="1280" height="720"><section id="2" data-footer="Carlos Menezes ![License CC BY-NC-SA 4.0](../cc-by-nc-sa.png)" lang="pt-BR" style="--footer:Carlos Menezes ![License CC BY-NC-SA 4.0](../cc-by-nc-sa.png);">
@@ -131,7 +131,7 @@ <h4 id="time-remaining-today">Time remaining today</h4>
131131
<h1 id="open-development-1">Open Development</h1>
132132
<p><img src="capa.svg" alt="" style="width:300px;" /></p>
133133
<h5 id="software-documentation-5">Software Documentation</h5>
134-
<h6 id="vers%C3%A3o-20252---carlos-menezes-carlosedminsperedubr-1">Versão 2025/2 - Carlos Menezes (<a href="mailto:[email protected]">[email protected]</a>)</h6>
134+
<h6 id="vers%C3%A3o-20252---carlos-menezes-carlosedminsperedubr">Versão 2025/2 - Carlos Menezes (<a href="mailto:[email protected]">[email protected]</a>)</h6>
135135
<footer>Carlos Menezes <img src="../cc-by-nc-sa.png" alt="License CC BY-NC-SA 4.0" /></footer>
136136
</section>
137137
<script>!function(){"use strict";const t={h1:{proto:()=>HTMLHeadingElement,attrs:{role:"heading","aria-level":"1"},style:"display: block; font-size: 2em; margin-block-start: 0.67em; margin-block-end: 0.67em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;"},h2:{proto:()=>HTMLHeadingElement,attrs:{role:"heading","aria-level":"2"},style:"display: block; font-size: 1.5em; margin-block-start: 0.83em; margin-block-end: 0.83em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;"},h3:{proto:()=>HTMLHeadingElement,attrs:{role:"heading","aria-level":"3"},style:"display: block; font-size: 1.17em; margin-block-start: 1em; margin-block-end: 1em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;"},h4:{proto:()=>HTMLHeadingElement,attrs:{role:"heading","aria-level":"4"},style:"display: block; margin-block-start: 1.33em; margin-block-end: 1.33em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;"},h5:{proto:()=>HTMLHeadingElement,attrs:{role:"heading","aria-level":"5"},style:"display: block; font-size: 0.83em; margin-block-start: 1.67em; margin-block-end: 1.67em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;"},h6:{proto:()=>HTMLHeadingElement,attrs:{role:"heading","aria-level":"6"},style:"display: block; font-size: 0.67em; margin-block-start: 2.33em; margin-block-end: 2.33em; margin-inline-start: 0px; margin-inline-end: 0px; font-weight: bold;"},span:{proto:()=>HTMLSpanElement},pre:{proto:()=>HTMLElement,style:"display: block; font-family: monospace; white-space: pre; margin: 1em 0; --marp-auto-scaling-white-space: pre;"}},e="data-marp-auto-scaling-wrapper",i="data-marp-auto-scaling-svg",n="data-marp-auto-scaling-container";class s extends HTMLElement{container;containerSize;containerObserver;svg;svgComputedStyle;svgPreserveAspectRatio="xMinYMid meet";wrapper;wrapperSize;wrapperObserver;constructor(){super();const t=t=>([e])=>{const{width:i,height:n}=e.contentRect;this[t]={width:i,height:n},this.updateSVGRect()};this.attachShadow({mode:"open"}),this.containerObserver=new ResizeObserver(t("containerSize")),this.wrapperObserver=new ResizeObserver(((...e)=>{t("wrapperSize")(...e),this.flushSvgDisplay()}))}static get observedAttributes(){return["data-downscale-only"]}connectedCallback(){this.shadowRoot.innerHTML=`\n<style>\n svg[${i}] { display: block; width: 100%; height: auto; vertical-align: top; }\n span[${n}] { display: table; white-space: var(--marp-auto-scaling-white-space, nowrap); width: max-content; }\n</style>\n<div ${e}>\n <svg part="svg" ${i}>\n <foreignObject><span ${n}><slot></slot></span></foreignObject>\n </svg>\n</div>\n `.split(/\n\s*/).join(""),this.wrapper=this.shadowRoot.querySelector(`div[${e}]`)??void 0;const t=this.svg;this.svg=this.wrapper?.querySelector(`svg[${i}]`)??void 0,this.svg!==t&&(this.svgComputedStyle=this.svg?window.getComputedStyle(this.svg):void 0),this.container=this.svg?.querySelector(`span[${n}]`)??void 0,this.observe()}disconnectedCallback(){this.svg=void 0,this.svgComputedStyle=void 0,this.wrapper=void 0,this.container=void 0,this.observe()}attributeChangedCallback(){this.observe()}flushSvgDisplay(){const{svg:t}=this;t&&(t.style.display="inline",requestAnimationFrame((()=>{t.style.display=""})))}observe(){this.containerObserver.disconnect(),this.wrapperObserver.disconnect(),this.wrapper&&this.wrapperObserver.observe(this.wrapper),this.container&&this.containerObserver.observe(this.container),this.svgComputedStyle&&this.observeSVGStyle(this.svgComputedStyle)}observeSVGStyle(t){const e=()=>{const i=(()=>{const e=t.getPropertyValue("--preserve-aspect-ratio");if(e)return e.trim();return`x${(({textAlign:t,direction:e})=>{if(t.endsWith("left"))return"Min";if(t.endsWith("right"))return"Max";if("start"===t||"end"===t){let i="rtl"===e;return"end"===t&&(i=!i),i?"Max":"Min"}return"Mid"})(t)}YMid meet`})();i!==this.svgPreserveAspectRatio&&(this.svgPreserveAspectRatio=i,this.updateSVGRect()),t===this.svgComputedStyle&&requestAnimationFrame(e)};e()}updateSVGRect(){let t=Math.ceil(this.containerSize?.width??0);const e=Math.ceil(this.containerSize?.height??0);void 0!==this.dataset.downscaleOnly&&(t=Math.max(t,this.wrapperSize?.width??0));const i=this.svg?.querySelector(":scope > foreignObject");if(i?.setAttribute("width",`${t}`),i?.setAttribute("height",`${e}`),this.svg&&(this.svg.setAttribute("viewBox",`0 0 ${t} ${e}`),this.svg.setAttribute("preserveAspectRatio",this.svgPreserveAspectRatio),this.svg.style.height=t<=0||e<=0?"0":""),this.container){const t=this.svgPreserveAspectRatio.toLowerCase();this.container.style.marginLeft=t.startsWith("xmid")||t.startsWith("xmax")?"auto":"0",this.container.style.marginRight=t.startsWith("xmi")?"auto":"0"}}}const r=(t,{attrs:e={},style:i})=>class extends t{constructor(...t){super(...t);for(const[t,i]of Object.entries(e))this.hasAttribute(t)||this.setAttribute(t,i);this._shadow()}static get observedAttributes(){return["data-auto-scaling"]}connectedCallback(){this._update()}attributeChangedCallback(){this._update()}_shadow(){if(!this.shadowRoot)try{this.attachShadow({mode:"open"})}catch(t){if(!(t instanceof Error&&"NotSupportedError"===t.name))throw t}return this.shadowRoot}_update(){const t=this._shadow();if(t){const e=i?`<style>:host { ${i} }</style>`:"";let n="<slot></slot>";const{autoScaling:s}=this.dataset;if(void 0!==s){n=`<marp-auto-scaling exportparts="svg:auto-scaling" ${"downscale-only"===s?"data-downscale-only":""}>${n}</marp-auto-scaling>`}t.innerHTML=e+n}}};let o;const a=Symbol();let l;const c="marpitSVGPolyfill:setZoomFactor,",d=Symbol(),h=Symbol();const g=()=>{const t="Apple Computer, Inc."===navigator.vendor,e=t?[u]:[],i={then:e=>(t?(async()=>{if(void 0===l){const t=document.createElement("canvas");t.width=10,t.height=10;const e=t.getContext("2d"),i=new Image(10,10),n=new Promise((t=>{i.addEventListener("load",(()=>t()))}));i.crossOrigin="anonymous",i.src="data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2210%22%20height%3D%2210%22%20viewBox%3D%220%200%201%201%22%3E%3CforeignObject%20width%3D%221%22%20height%3D%221%22%20requiredExtensions%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22width%3A%201px%3B%20height%3A%201px%3B%20background%3A%20red%3B%20position%3A%20relative%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3C%2Fsvg%3E",await n,e.drawImage(i,0,0),l=e.getImageData(5,5,1,1).data[3]<128}return l})().then((t=>{null==e||e(t?[u]:[])})):null==e||e([]),i)};return Object.assign(e,i)};let p,m;function u(t){const e="object"==typeof t&&t.target||document,i="object"==typeof t?t.zoom:t;window[h]||(Object.defineProperty(window,h,{configurable:!0,value:!0}),document.body.style.zoom=1.0001,document.body.offsetHeight,document.body.style.zoom=1,window.addEventListener("message",(({data:t,origin:e})=>{if(e===window.origin)try{if(t&&"string"==typeof t&&t.startsWith(c)){const[,e]=t.split(","),i=Number.parseFloat(e);Number.isNaN(i)||(m=i)}}catch(t){console.error(t)}})));let n=!1;Array.from(e.querySelectorAll("svg[data-marpit-svg]"),(t=>{var e,s,r,o;t.style.transform||(t.style.transform="translateZ(0)");const a=i||m||t.currentScale||1;p!==a&&(p=a,n=a);const l=t.getBoundingClientRect(),{length:c}=t.children;for(let i=0;i<c;i+=1){const n=t.children[i];if(n.getScreenCTM){const t=n.getScreenCTM();if(t){const i=null!==(s=null===(e=n.x)||void 0===e?void 0:e.baseVal.value)&&void 0!==s?s:0,c=null!==(o=null===(r=n.y)||void 0===r?void 0:r.baseVal.value)&&void 0!==o?o:0,d=n.children.length;for(let e=0;e<d;e+=1){const s=n.children[e];if("SECTION"===s.tagName){const{style:e}=s;e.transformOrigin||(e.transformOrigin=`${-i}px ${-c}px`),e.transform=`scale(${a}) matrix(${t.a}, ${t.b}, ${t.c}, ${t.d}, ${t.e-l.left}, ${t.f-l.top}) translateZ(0.0001px)`;break}}}}}})),!1!==n&&Array.from(e.querySelectorAll("iframe"),(({contentWindow:t})=>{null==t||t.postMessage(`${c}${n}`,"null"===window.origin?"*":window.origin)}))}function v({once:t=!1,target:e=document}={}){const i=function(t=document){if(t[d])return t[d];let e=!0;const i=()=>{e=!1,delete t[d]};Object.defineProperty(t,d,{configurable:!0,value:i});let n=[],s=!1;(async()=>{try{n=await g()}finally{s=!0}})();const r=()=>{for(const e of n)e({target:t});s&&0===n.length||e&&window.requestAnimationFrame(r)};return r(),i}(e);return t?(i(),()=>{}):i}p=1,m=void 0;const w=Symbol(),b=(e=document)=>{if("undefined"==typeof window)throw new Error("Marp Core's browser script is valid only in browser context.");if(((e=document)=>{const i=window[a];i||customElements.define("marp-auto-scaling",s);for(const n of Object.keys(t)){const s=`marp-${n}`,a=t[n].proto();(o??(o=!!document.createElement("div",{is:"marp-auto-scaling"}).outerHTML.startsWith("<div is"),o))&&a!==HTMLElement?i||customElements.define(s,r(a,{style:t[n].style}),{extends:n}):(i||customElements.define(s,r(HTMLElement,t[n])),e.querySelectorAll(`${n}[is="${s}"]`).forEach((t=>{t.outerHTML=t.outerHTML.replace(new RegExp(`^<${n}`,"i"),`<${s}`).replace(new RegExp(`</${n}>$`,"i"),`</${s}>`)})))}window[a]=!0})(e),e[w])return e[w];const i=v({target:e}),n=()=>{i(),delete e[w]},l=Object.assign(n,{cleanup:n,update:()=>b(e)});return Object.defineProperty(e,w,{configurable:!0,value:l}),l},y=document.currentScript;b(y?y.getRootNode():document)}();

docs/lessons/03-software-documentation/slides_cedm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Open Development
2727

2828

2929

30-
###### Versão 2025/2 - Carlos Menezes ([email protected])
30+
###### Edition 2025/2 - Carlos Menezes ([email protected])
3131
---
3232

3333
# Software Documentation

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

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# 05 - Distribuição de Software
1+
# 05 - Distribution of Software
22

3-
Nesta aula complementaremos as últimas discussões criando um pequeno pacote Python instalável via `pip`. Com isto chegamos mais perto de um projeto que esteja preparado para que outras pessoas o utilizem e colaborem em seu desenvolvimento.
3+
In this lesson we will complement the latest discussions creating a small Python package installed via `pip`. With this we come closer to a project that is prepared for others to use and collaborate in its development.
44

5-
## Distribuindo software para desenvolvedores: pacote Python básico
5+
## Distributing software to developers: basic Python package
66

7-
Nosso módulo se chamará `dev_aberto` e disponibilizará um programa executável `hello.py`. Crie a seguinte estrutura de pastas para nosso pacote.
7+
Our module will be called `dev_aberto` and provide an executable program `hello.py`. Create the following folder structure for our package.
88

99
!!! important
10-
Baixe os arquivos que usaremos [neste link](https://github.com/Insper/open-dev/tree/master/docs/lessons/05-python-packaging)
10+
Download the files we will use at this [link](https://github.com/Insper/open-dev/tree/master/docs/lessons/05-python-packaging)
1111

1212
~~~
13-
pacote_exemplo/
13+
package_example/
1414
dev_aberto/
1515
__init__.py
1616
dev_aberto.py
@@ -21,76 +21,79 @@ pacote_exemplo/
2121
~~~
2222

2323
!!! exercise
24-
com a estrutura acima, qual seria o `import` a ser feito para usar a função `hello` do arquivo *dev_aberto.py*?
24+
Considering above structure, what would be the appropriate `import` command at a *Python* script to use `hello` function from *dev_aberto.py* file?
2525

2626
!!! exercise
27-
Pesquise para que serve o arquivo **`__init__.py`** e use-o para permitir importar `hello` usando somente `import dev_aberto`.
27+
Search what **`__init__.py`** file is for and use it to allow import `hello` function using only `import dev_aberto`.
2828

29-
!!! exercise
30-
Crie um projeto no github para esta atividade. Faça um primeiro commit nele com o conteúdo "zerado" do projeto.
3129

32-
- Um arquivo *README* contendo uma frase de descrição do pacote e um link para o repositório da disciplina.
33-
- Um arquivo *LICENSE* com a licença MIT.
30+
!!! exercise
31+
Create a project in github for this activity. Make a first commit to this project without programming content.
3432

33+
- A *README* file containing a description phrase of the package and a link to discipline repository.
34+
- A *LICENSE* file with MIT license.
3535

36-
### O arquivo `setup.py`
36+
### File `setup.py`
3737

38-
A descrição de um pacote Python é feita usando um arquivo setup.py Veja abaixo uma versão inicial deste arquivo:
38+
Description of a Python package is made using a `setup.py` file. See below an initial version of this file:
3939

4040
~~~{.py}
4141
from setuptools import setup
4242
43-
setup(name='dev_aberto_seunome',
43+
setup(name='dev_aberto_Your_Name',
4444
version='0.1',
4545
packages=['dev_aberto']
4646
)
4747
~~~
4848

4949
!!! exercise
50-
Crie o arquivo acima no seu projeto, substituindo *seunome* por .... seu nome. Instale o seu próprio pacote usando
50+
Create the above file in your project by replacing *Your_name* by ... your name. Install your own package using
5151

5252
> pip install .
5353

5454
!!! exercise
55-
Em outra pasta, abra um console Python e tente importar seu módulo.
55+
In another folder, open a Python console and try to import your module.
5656

5757
!!! exercise
58-
Pesquise quais argumentos são usados para especificar o autor do pacote, as versões de Python e sistemas operacionais suportados. Preencha estes valores com suas informações. Note que o `pip` leva estas informações em conta e só instalará um pacote se ele estiver em um ambiente suportado.
58+
Find out what arguments are used to specify package author, Python versions, and supported operating systems. Fill these values with your information. Please note that `pip` take this information into account and will only install a package if it is in a supported environment.
5959

60-
### Dependências
60+
### Dependencies
6161

62-
Para adicionar pacotes que são automaticamente instalados quando instalamos nosso pacote precisamos identificá-los no nosso arquivo *setup.py*. Para adicionar uma dependência de instalação basta adicionar o seguinte argumento:
62+
To add packages that are automatically installed when we install our package we need to identify them in our *setup.py* file. To add an installation dependency just add the following argument:
6363

6464
~~~
6565
...
6666
install_requires=[
67-
'pacote>=1.0',
68-
'pacote2'
67+
'packaage1>=1.0',
68+
'package2'
6969
],
7070
...
7171
~~~
7272

7373

7474
!!! exercise
75-
Verifique as dependências do código e adicione-as no `setup.py`.
75+
Check the code dependencies and add them to `setup.py`...
7676

7777
### requirements.txt
7878

7979
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.
80+
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.
8081

8182
!!! exercise
82-
Crie um *requirements.txt* para seu projeto com as mesmas dependências listadas no seu *setup.py*.
83+
Create a *requirements.txt* file for your project with the same dependencies listed on your *setup.py*.
8384

84-
### Scripts executáveis
85+
### Runnable Scripts
8586

8687
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.
8788

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.
90+
8891
~~~
8992
...
9093
scripts=['scripts/hello.py'],
9194
...
9295
~~~
93-
96+
9497
Não se esqueça de adicionar a seguinte linha no topo de seu arquivo para que ele possa ser executado diretamente do shell:
9598

9699
~~~

0 commit comments

Comments
 (0)