Herramientas de usuario

Herramientas del sitio


wiki2:python:libraries

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
wiki2:python:libraries [2019/08/09 14:50]
alfred [Little ones]
wiki2:python:libraries [2021/04/24 11:21] (actual)
Línea 11: Línea 11:
   * ''​object??''​   * ''​object??''​
   * ''​object?''​   * ''​object?''​
-  * ''​%quickref''​+  * ''​%quickref''​ o ''​%magic''​
   * ''​%run -i hello.py'',​ run interactively hello.py   * ''​%run -i hello.py'',​ run interactively hello.py
   * ''​%run hello.py'',​ run hello.py   * ''​%run hello.py'',​ run hello.py
-===== Fabric =====+ 
 +Launch it as GUI command: 
 +<​code>​ 
 +mate-terminal -e ipython 
 +</​code>​ 
 + 
 +To make ipython reload loaded modules: 
 +<​code>​ 
 +%load_ext autoreload ​                                                                                                                                                                                    
 +%autoreload 2  
 +</​code>​ 
 +===== Fabric ​=====
  
 ==== Open connections ==== ==== Open connections ====
 <​code>​ <​code>​
 result = Connection('​127.0.0.1',​ port=2222, user="​root",​ connect_kwargs={"​password":​ "​test"​}).run('​uname -s', hide=True) result = Connection('​127.0.0.1',​ port=2222, user="​root",​ connect_kwargs={"​password":​ "​test"​}).run('​uname -s', hide=True)
 +</​code>​
 +
 +==== Execute on a remote folder ====
 +
 +<​code>​
 +connection = Connection('​127.0.0.1',​ port=2222, user="​root",​ connect_kwargs={"​password":​ "​test"​})
 +with connection.cd('/​var/​www'​):​
 +   ​result = connection.run(command)
 +</​code>​
 +
 +===== pycalver | bumpver =====
 +
 +  * https://​gitlab.com/​mbarkhau/​pycalver
 +
 +Instalar:
 +<​code>​
 +poetry add bumpver
 +</​code>​
 +
 +Iniciar proyecto:
 +<​code>​
 +bumpver init
 +</​code>​
 +
 +En ''​pyproject.toml''​ tendrás la inicialización. Al iniciar y no existir dará un "​error"​.
 +
 +Mi version_pattern escogido es:
 +<​code>​
 +version_pattern = "​YYYY.WW[.PATCH]"​
 +</​code>​
 +
 +Lo mejor es asegurarse de que quede algo así:
 +<​code>​
 +[tool.bumpver]
 +current_version = "​2021.0.0"​
 +version_pattern = "​YYYY.WW[.PATCH]"​
 +commit_message = "bump version {old_version} -> {new_version}"​
 +commit = true
 +tag = true
 +push = false
 +
 +
 +[tool.bumpver.file_patterns]
 +"​pyproject.toml"​ = [
 +    '​current_version = "​{version}"',​
 +]
 +</​code>​
 +
 +Para ejecutar una subida de versión de prueba (si quieres subir el patch has de añadir: ''​-p''​):​
 +<​code>​
 +bumpver update --dry
 </​code>​ </​code>​
 ===== Artículos ===== ===== Artículos =====
   * http://​blog.yhathq.com/​posts/​11-python-libraries-you-might-not-know.html   * http://​blog.yhathq.com/​posts/​11-python-libraries-you-might-not-know.html
  
wiki2/python/libraries.1565362200.txt.gz · Última modificación: 2020/05/09 09:24 (editor externo)