THIS IS A DRAFT! It will appear on the main page once finished!
How I write and package Python
Opinionated guide
Table of Contents
- 1. TODOHow i write in Pythonblogpython
- 2. TODO Hypermodern Python | Hacker Newspythonblog
- 3. TODOexample of setup. py with literate dependenciespythonlp
- 4. code stylepythonblog
- 5. instead, rely on your text editor?guidepython
- 6. TODOwrite guide – python from easy to inf??python
- 7. TODOpost pymplateblog
¶1 TODOHow i write in Pythonblogpython
I'm describing what's my process Maybe you're opinionated about different things.. Make your own judgments
¶2 TODO Hypermodern Python | Hacker Newspythonblog
comment:
boring and slightly opinitionated python guide
¶2.1 several 'layers'
- git + gitignore
- single executable script start using type annotations, IDE (LSP/flycheck/intellij) already helps
add tests keep tests in the same file, run manually now and then
(run tests during import?) not a great idea in general, but okay to start with
TODO doctests
TODO framework: unittest is annoying. even though it's built in, it introduces friction assert len(x) == 10 vs assert self.assertEquals TODO
- dependencies: rely on symlinks
- typing: keep reasonable default config, so you can simply run mypy file.py
- no pylint most of my projects I work on my own, so I don't care about debatable code qualities metrics. TODO opinitionated etc
- no autoformatting similar, and I feel that often they only make things worse by removning meaningful space and tabulations
- documentation: warning: opinitonated keep as much as you can in the docstrings and help examples: doctests
¶2.2 seen this article. It makes sense for me as someone who's had a fair deal of Python experience
But if it was the first article I seen? It would absolutely terrify me.
- You need very little to be productive in Python
- You don't have to be fancy TODO.
- Not every package needs to be running under a virtual environment, linted and continuously integrated. It gets in the way of flexibility TODO and can be frustrating. TODO e.g. submodules