As you may have already noticed, setuptools is deprecating ez_setup.py, the module that allowed setuptools to install itself. With that, it has become evident that zc.buildout will no longer be able to self-bootstrap and, at a certain point, it will be removed. So far, a hack is put in place pinning the version of setuptools to 33.0.0 (it is now on 34.3.1 already...), which is the last to provide this functionality. See:
$ python bootstrap-buildout.pyez_setup.py is deprecated and when using it setuptools will be pinned to 33.1.1 since it's the last version that supports setuptools self upgrade/installation, check https://github.com/pypa/setuptools/issues/581 for more info; use pip to install setuptoolsDownloading https://pypi.io/packages/source/s/setuptools/setuptools-33.1.1.zip...
I propose:
we start shipping zc.buildout as part of our bob-devel environment and as a bob dependence
we remove bootstrap-buildout.py from all packages
after activating the conda environment, the user does only buildout (instead of ./bin/buildout)
update instructions on bob.extension's guide to reflect these changes.
I tested the above changes and that seems to work fine. Are there any objections?
@andre.anjos If you know how to do that, please go ahead. I actually like it better to have only one step instead of two (bootstrap & bin/buildout). This makes it (a little) easier for people to install our packages.
I think the instruction on the readme files should just be:
for core bob packages:
This package is a **core** bob package. Please install bob or if you want to install just this package after you have added our channel:conda install bob.package
for the rest:
This package is an **extra** or **extension** or **satellite** bob package. Please install bob first and then:pip install bob.package
Ok, I think I have this figured out. We used to advertise buildout for both installation and development but now I think we can replace this by combination of conda and pip. Here are the scenarios:
You can achieve the isolation that buildout provides for different experiments with conda environments.
conda create -n test_environment python=2 bob. This would also mean we move away from central conda installations too.
Install a package: conda install <package>
This cannot be easier than this. We will provide conda packages for all packages soon.
Install a package from source into your python environment:
conda install -n <env-name> gcc=4 libgcc=4 toolchain This line would be available in the documentation.
Having toolchain installed is important here. This sets some release mode compilation flags. Also some compilation flags to guarantee ABI compatibility with packages from our conda channel.
source activate <env-name>
activate the environment to make sure the flags are set.
* This will clone these requirements in `./src` and install them in develop mode. * Now there is a problem that this packages may get compiled a couple of times because they depend on each other. To avoid that you can do: * `tr '\n' '\0' < requirements.txt | xargs -0 -n 1 pip install `I think with a couple of changes in `bob.extension` and providing some scripts in `bob.extension` to ease the execution of commands above, we can totally ditch `buildout` and have faster development environments.However, this need some training but I am willing to provide that if we decide to go this way.@andre.anjos @pkorshunov @tiago.pereira @mguenther what do you think?Further reading: https://pip.pypa.io/en/stable/user_guide/ and https://conda.io/docs/get-started.html
My only concern is that the new way does not make it harder to work compared to the old way. Currently, I need to run one command and will get packages needed for development inside ./src folder. I can modify these packages as I like, push back changes to git, if I want, and so on. Will this new approach allow me the same flexibility and ease of development? And what is the benefit? I'm also worried that we may stumble on some unexpected problems along the way.
My only concern is that the new way does not make it harder to work compared to the old way. Currently, I need to run one command and will get packages needed for development inside ./src folder. I can modify these packages as I like, push back changes to git, if I want, and so on. Will this new approach allow me the same flexibility and ease of development?
We don't need to wait two minutes each time we run buildout.
Our development will be more like the rest of Python developers using well tested and broadly used official tools.
I'm also worried that we may stumble on some unexpected problems along the way.
Probably but since we already use setuptools and pip for distribution the problems should be minimal. I have done some tests on different use cases and compared them to buildout. So far except doing a couple of extra commands and some required knowledge I have not seen a problem.
I don't know about hype or not but buildout seems like a monkey patched version of setuptools which does not seem to see much of development anymore. However pip is the official way of doing things which builds upon setuptools in a proper way and their development goes hand to hand under one organization: https://github.com/pypa/
I was just reviewing this - I'm in favor of exploring ways to avoid buildout. Still, it is not unmaintained - it is just not going to the same place we are. It is a tool for deploying pure-Python packages.
Pip also have problems:
As you have already noticed, you can't pip install all packages at once as we can with buildout (provided bob.buildout is used on the extension list)
We'll be replacing one single entry point by multiple different commands - or see 3.
The solution using bob.extension may be good, but we have to investigate it with care. A solution with a package that does not depend on Bob may be easier to use. We'd need to mimick this bootstrap/buildout at a certain point though. The starting point is having miniconda installed somewhere.
The minimum workflow could be the following:
User pre-installs miniconda somewhere (user maintains this, so it is not really part of the everyday procedure)
User downloads a script from somewhere (maybe bob.extension)
User executes said script with a "requirements.txt" or similar file as you examplified - after that, the environment is ready for use
Another option:
Same as before
All users include a copy of the bootstrap script with their package
To get the environment ready, user runs the bootstrap script against requirements.txt or similar as you examplified
About the development aspect; honestly, aside from Bob and its satellites, I've never collaborated to projects where I needed to constantly patch the dependencies too. Most of the time I'm working with 2 or 3 dependencies.
This feature from zc.buildout is just great. In one shot pull everything, either from git, from a certain branch from git, something in your file system.
Would be good to do this with pip (I know this feature https://pip.pypa.io/en/stable/reference/pip_install/#git).
I'm kinda agree with @amohammadi, if you are developing you should know a little about it, but if you can make it simpler this would destroy one barrier in our development cycle.
I think all theses problems stem from the fact that instead of putting these things in documentation we just create magical scripts that sets up development environment for people. This puts pressure on us maintaining these scripts. Whenever for some reason somebody's buildout breaks is because they are not trained enough and they keep blaming it on us who know and have actually put time and investigated this. If the developer doesn't know about these things maybe they shouldn't be developing these packages in the first place.
I do not think we should be dropping support for buildout. Instead we can have two development guides in bob.extension. One using pip and one using buildout. People (developers) should be free to use whatever they want as long as they know what they are doing.
So my conclusion is to remove mentions of buildout from documentation: bob#241 (closed) and assume that when people want to use (not develop) something, they have installed the package with either conda or pip. Then just have one or two developer guides only in one place that explains the peculiarities of buildout or pip or whatever.
I mean how hard is it to tell people that you need to export debug flags if you want to compile in debug mode. Or that you need to compile theses packages one by one because pip can't handle it.
Developing with pip is bound to work out of the box, so why not adding a section on the manual? Looks like a good compromise for the time being. We should keep an eye on feedback after this.
As for the script, only experience will tell. My gut feeling at this point is that remembering command-lines is hard and people tend to code this in scripts. Each will have one and we'll end-up debugging those rather than buildout or our own script. Not having the script does not necessarily mean it is going to be easier to handle people's requests, unfortunately. It is a complex problem.