development:python:start

Aquesta és una revisió antiga del document


PYTHON

  • Use Poetry for package management:
    curl -sSL https://install.python-poetry.org | python3 -
mkdir my-project && cd my-project
# Make sure the standard .gitignore is set
curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
# init and activate virtual environment
python3 -m venv ./venv && source venv/bin/activate
# init Poetry. It will rely only the previously created venv, if activated.
poetry init -q
poetry add -g test flake8 autopep8 flake8-annotation
poetry install --only test
# Using Flake8 for lint
poetry run flake8 src
# Enforce styling
poetry run autopep8 --in-place --recursive src
# Using pytype for type checking
poetry run #TODO

/via: https://code.europa.eu/digit-c4/dev/python-best-practices

otros

  • development/python/start.1728393719.txt.gz
  • Darrera modificació: 08/10/2024 06:21
  • per mate