Ask HN: Programming without a build system?
&gt; trying to build a lifeboat for Twitter, Python works, but then modules require builds that break.<p>&gt; Alternatively, any good resources for the above?<p>There are many, <i>unbelievably many</i> writeups and tools for Python building and packaging. Some of them are really neat! But paralysis of choice is real. So is the reality that many of the new&#x2F;all-in-one&#x2F;cutting edge tools, however superior they may be, just won&#x27;t get long term support needed to catch on and stay relevant.<p>When getting started with Python, I <i>very personally</i> like to choose from a few simple options (others are likely to pipe up with their own, and that&#x27;s great; mine aren&#x27;t The One Right Way, just some fairly cold&#x2F;mainstream takes).<p>1. First pick what stack you&#x27;ll be using to develop and test software. In Python this is sadly often going to be different from the stack you&#x27;ll use to deploy&#x2F;run it in production, but here we are. There are two sub-choices to be made here:<p>1.a. How will you be running the <i>Python interpreter itself</i> in dev&#x2F;test (in other words, what Python language version you will use)? &quot;I just want to use the Python that came with my laptop&quot; is fine to a point, but breaks down a lot sooner than folks expect (again, the reasons for this are variously reasonable and stupid, but here we are). Personally, I like pyenv (<a href="https:&#x2F;&#x2F;github.com&#x2F;pyenv&#x2F;pyenv" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pyenv&#x2F;pyenv</a>) here. It&#x27;s a simple tool that builds interpreters  on your system and provides shell aliases to adjust pathing so they can optionally be used. At the opposite extreme from pyenv, some folks choose Python-in-Docker here (pros: reproducible, makes deployment environments very consistent with dev; cons: IDE&#x2F;quick build-and-run automations get tricker). There are some other tools that wrap&#x2F;automate the same stuff that pyenv does.<p>1.b. How will you be isolating your project&#x27;s dependencies? &quot;I want to install dependencies globally&quot; breaks down (or worse, breaks your laptop!) pretty quickly, yes it&#x27;s a bummer. There are three options here: if you really eschew automations&#x2F;wrappers&#x2F;thick tools in general, you can do this yourself (i.e. via &quot;pip install --local&quot;, optionally in a dedicated development workstation user account); you can use venv (<a href="https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;venv.html" rel="nofollow">https:&#x2F;&#x2F;docs.python.org&#x2F;3&#x2F;library&#x2F;venv.html</a> stdlib version of virtualenv, yes the names suck and confusing, here we are etc. etc.), which is widely standardized upon and manually use &quot;pip install&quot; while inside your virtualenv, and you can optionally integrate your virtualenv with pyenv so &quot;inside your virtualenv&quot; is easy to achieve via pyenv-virtualenv (<a href="https:&#x2F;&#x2F;github.com&#x2F;pyenv&#x2F;pyenv-virtualenv);" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;pyenv&#x2F;pyenv-virtualenv);</a> or you can say &quot;hell with this, I want maximum convenience via a wrapper that manages my whole project&quot; and use Poetry or an equivalent all-in-one project management tool (<a href="https:&#x2F;&#x2F;python-poetry.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;python-poetry.org&#x2F;</a>). There&#x27;s no right point on that spectrum, it&#x27;s up to you to decide where you fall on the &quot;I want an integrated experience and to start prototyping quickly&quot; versus &quot;I want to reduce customizations&#x2F;wrappers&#x2F;tooling layers&quot; spectrum.<p>2. Then, pick <i>how</i> you&#x27;ll be developing said software: what frameworks or tools you&#x27;ll be using. A Twitter lifeboat sounds like a webapp, so you&#x27;ll likely want a web framework. Python has a spectrum of those of varying &quot;thickness&quot;&#x2F;batteries-included-ness. At the minimum of thickness are tools like Flask (<a href="https:&#x2F;&#x2F;flask.palletsprojects.com&#x2F;en&#x2F;2.2.x&#x2F;" rel="nofollow">https:&#x2F;&#x2F;flask.palletsprojects.com&#x2F;en&#x2F;2.2.x&#x2F;</a>) and Sanic (like Flask, but with a bias towards performance at the cost of using async and some newer Python programming techniques which tend, in Python, to be harder than the traditional Flask approach: <a href="https:&#x2F;&#x2F;sanic.dev" rel="nofollow">https:&#x2F;&#x2F;sanic.dev</a>). At the maximum of thickness are things like Django&#x2F;Pyramid (<a href="https:&#x2F;&#x2F;www.djangoproject.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.djangoproject.com&#x2F;</a>). With the minimally-thick frameworks you&#x27;ll end up plugging together other libraries for things like e.g. database access or web content serving&#x2F;templating, with the maximally-thick approach that is included but opinionated. Same as before: no right answers, but be clear on the axis (or axes) along which you&#x27;re choosing.<p>3. Choose how you&#x27;ll be deploying&#x2F;running the software, maybe after prototyping for awhile. This isn&#x27;t &quot;lock yourself into a cloud provider&#x2F;hosting platform&quot;, but rather a choice about what tools you use with the hosting environment. Docker is pretty uncontentious here, if you want a generic way to run your Python app on many environments. So is &quot;configure  Linux instances to run equivalent Python&#x2F;package versions to your dev&#x2F;test environment&quot;. If you choose the latter, be aware that (and this is very important&#x2F;often not discussed) many tools that the Python community suggests for <i>local development or testing</i> are very unsuitable for managing production environments (e.g. a tool based around shell state mutation is going to be extremely inconvenient to productionize). I guess nowadays there&#x27;s an opinionated extreme in the form of serverless environments that eat a zipfile of Python code and ensure it runs somewhere; if you choose to deploy on those, then your decisions about points 1 and 2 above will likely be guided&#x2F;reassessed based on the opinions of the deployment platform re: what Python versions and packaging techniques are supported.<p>Yeah, that&#x27;s a lot of choices, but in general there are some pretty obvious&#x2F;uncontentious paths there. Pyenv-for-interpreters&#x2F;Poetry-for-packaging-and-project-management&#x2F;Flask-for-web-serving&#x2F;Docker-for-production is not going to surprise anyone or break any assumptions. Docker&#x2F;raw-venv&#x2F;Django is going to be just as easy to Google your way through. And if you <i>really</i> don&#x27;t want to think about things right now and just want to get hello-world in your browser right away, there&#x27;s always cookiecutters (e.g. <a href="https:&#x2F;&#x2F;github.com&#x2F;cookiecutter&#x2F;cookiecutter-django" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;cookiecutter&#x2F;cookiecutter-django</a>).<p>Again, no one obvious right way (ha!) but plenty of valid options!<p>Not sure if that&#x27;s what you were after. If you want a &quot;just show me how to get started&quot;-type writeup rather than an overview on the choices involved, I&#x27;m sure folks here or some quick googling will turn up many!