Best practice for deployment

35 views
Skip to first unread message

Anders Wegge Keller

unread,
May 17, 2020, 10:48:06 AM5/17/20
to pylons-discuss
As the subject says, what's the best way of deploying a project? So far,
I've made a sdist on my development system, that I install in an environment
on the production system. While it works fine, I worry that repeated
installations of newer versions will leave behind a lot of clutter. So are
there a better wwy to deploy?

--
//Wegge

Mike Orr

unread,
May 17, 2020, 2:01:28 PM5/17/20
to pylons-...@googlegroups.com
I either check out the source on the server and install into a Conda
environment, or make a Docker image. sdists are mainly for
distributing your package on PyPI. We're gradually migrating our
webapps to Docker. We're using Conda inside Docker for various reasons
but that's not essential.

"I worry that repeated installations of newer versions will leave
behind a lot of clutter."

I'm not quite sure what you mean. If you pip install something without
-e it will delete the files from the previous version. If you install
it with -e it would leave stray '.pyc' files from modules you've
deleted, but you usually know if you've deleted modules so you can run
a shell script that recursively deletes all '*.pyc' files and
';__pycache__' directories. If you make an sdist into the same
directory repeatedly, it might similarly leave obsolete files, but
only if you've deleted modules or removed things in setup.py. That's
easy to avoid; just delete the dist directory before building. If you
want something like sdist, you might look into 'bdist_wheel', which
moves some steps from the installer to the builder for efficiency.
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/20200517153659.6c6d25ec%40linuxawk.wegge.dk.



--
Mike Orr <slugg...@gmail.com>
Reply all
Reply to author
Forward
0 new messages