rholder / debinate Goto Github PK
View Code? Open in Web Editor NEWRoll up your projects into little standalone Debian packages.
License: Apache License 2.0
Roll up your projects into little standalone Debian packages.
License: Apache License 2.0
There exist some projects that don't play well together when installed in the same pip install
run. Provide a mechanism that installs required dependencies explicitly in the order they are specified instead of how the dependency graph is resolved from setuptools
.
Should either provide instructions, or get fancy and detect and prefer some of these non-BSD alternatives.
I had to
ln -s /usr/local/bin/gfind /usr/local/bin/find
ln -s /usr/local/bin/gxargs /usr/local/bin/xargs
which makes sense for me because my /usr/local/bin is before /usr/bin (where BSD commands live)
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:... #and so on
md5/md5sum may also be problematic but I already linked both command names in the past for reasons.
For completeness, the g* utils come from brew install coreutils
There's a chunk of hardcoded -d
depends references that are being passed to fpm
. Stop being lazy and add a config file in .debinate
to handle the list.
setup(
version='0.0.1'
)
I still get myapp-1.0.0 and the control file within says 1.0.0 as well
PR #13
Check for fpm
, virtualenv
, etc. before running debinate
.
This loop will miss the last line of a requirements.txt
unless it ends in a newline.
while read req; do
pip install $req
done <requirements.txt
Changes to dependencies held in a virtualenv
are not as frequent as application code changes. Add an option to allow the user to use the cached virtualenv
in /opt (where things are built) to avoid having to incur the time to compile/build/etc. for each packaging.
Add a feature to customize the target directory that the project is installed in. Currently it's hardcoded to /opt
.
$ sudo curl -o /usr/local/bin/debinate -L https://github.com/rholder/debinate/releases/download/v0.5.0/debinate && \
> sudo chmod +x /usr/local/bin/debinate && \
> sudo chown $USER:$USER /opt
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 581 0 581 0 0 1636 0 --:--:-- --:--:-- --:--:-- 1641
100 17550 100 17550 0 0 14109 0 0:00:01 0:00:01 --:--:-- 103k
chown: amcclosky: illegal group name
Corrected it with:
sudo chown $USER:staff /opt
There are a few environment variables that can be set that affect things like the project's name and version. Add these to the documentation and the help message.
Don't hardcode the distribute version. Add it as a parameter. The version is in there now to get around annoying MySQL-python
minimum version dependencies.
When the build folder is missing (e.g. a new project checkout from git where we ignore all empty directories) it doesn't get recreated and errors out.
I have seen this when building a few different debinate projects (all have been python3)
↪ export DEBINATE_PYTHON=$(which python3)
↪ debinate package
Cleaning out .debinate/target
Cleaning out .debinate/build
Building mything - 1.0.0
Clearing any virtualenv in /opt/mything/.virtualenv
Found requirements.txt, installing dependencies in order first...
Creating new virtualenv in /opt/mything/.virtualenv...
Using base prefix '/usr'
New python executable in /opt/mything/.virtualenv/bin/python3
Also creating executable in /opt/mything/.virtualenv/bin/python
Installing setuptools, pip, wheel...done.
Running virtualenv with interpreter /usr/bin/python3
Collecting distribute==0.7.3
Using cached distribute-0.7.3.zip
Requirement already satisfied: setuptools>=0.7 in /opt/mything/.virtualenv/lib/python3.5/site-packages (from distribute==0.7.3)
Requirement already satisfied: appdirs>=1.4.0 in /opt/mything/.virtualenv/lib/python3.5/site-packages (from setuptools>=0.7->distribute==0.7.3)
Requirement already satisfied: packaging>=16.8 in /opt/mything/.virtualenv/lib/python3.5/site-packages (from setuptools>=0.7->distribute==0.7.3)
Requirement already satisfied: six>=1.10.0 in /opt/mything/.virtualenv/lib/python3.5/site-packages (from setuptools>=0.7->distribute==0.7.3)
Requirement already satisfied: pyparsing in /opt/mything/.virtualenv/lib/python3.5/site-packages (from packaging>=16.8->setuptools>=0.7->distribute==0.7.3)
Building wheels for collected packages: distribute
Running setup.py bdist_wheel for distribute: started
Running setup.py bdist_wheel for distribute: finished with status 'error'
Complete output from command /opt/mything/.virtualenv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-zfa2fsu2/distribute/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp6oxttpbvpip-wheel- --python-tag cp35:
Traceback (most recent call last):
File "/tmp/pip-build-zfa2fsu2/distribute/pkg_resources.py", line 2680, in _dep_map
return self.__dep_map
File "/tmp/pip-build-zfa2fsu2/distribute/pkg_resources.py", line 2525, in __getattr__
raise AttributeError(attr)
AttributeError: _DistInfoDistribution__dep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-zfa2fsu2/distribute/setup.py", line 58, in <module>
setuptools.setup(**setup_params)
File "/usr/lib/python3.5/distutils/core.py", line 134, in setup
ok = dist.parse_command_line()
File "/tmp/pip-build-zfa2fsu2/distribute/setuptools/dist.py", line 276, in parse_command_line
result = _Distribution.parse_command_line(self)
File "/usr/lib/python3.5/distutils/dist.py", line 472, in parse_command_line
args = self._parse_command_opts(parser, args)
File "/tmp/pip-build-zfa2fsu2/distribute/setuptools/dist.py", line 602, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "/usr/lib/python3.5/distutils/dist.py", line 528, in _parse_command_opts
cmd_class = self.get_command_class(command)
File "/tmp/pip-build-zfa2fsu2/distribute/setuptools/dist.py", line 406, in get_command_class
ep.require(installer=self.fetch_build_egg)
File "/tmp/pip-build-zfa2fsu2/distribute/pkg_resources.py", line 2254, in require
working_set.resolve(self.dist.requires(self.extras),env,installer)))
File "/tmp/pip-build-zfa2fsu2/distribute/pkg_resources.py", line 2471, in requires
dm = self._dep_map
File "/tmp/pip-build-zfa2fsu2/distribute/pkg_resources.py", line 2682, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/tmp/pip-build-zfa2fsu2/distribute/pkg_resources.py", line 2699, in _compute_dependencies
from _markerlib import compile as compile_marker
ImportError: No module named '_markerlib'
----------------------------------------
Failed building wheel for distribute
Running setup.py clean for distribute
Failed to build distribute
Installing collected packages: distribute
Running setup.py install for distribute: started
Running setup.py install for distribute: finished with status 'done'
Successfully installed distribute-0.7.3
...
and it continues on to install all dependencies defined in requirements.txt
. debinate package
goes on to finish, and I have not found any issues with the generated deb files when this distribute error is present.
I have also found that if I remove my requirements.txt
file, and instead define the dependencies in setup.py
debinate follows this code path instead where pip install distribute==0.7.3
is not run. I do not see the error in this case, and I have also not experienced issues with the generated deb file this way either.
A little more details on my environment:
↪ cat /etc/os-release 1 ↵
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial
↪ debinate --version
Debinate 0.6.0 - roll up your project into a Debian package
↪ python3 --version 1 ↵
Python 3.5.2
TL;DR I don't know if this is an issue or not (hasn't been for me), but a distribute error in the logs is a little worrisome.
Create an end to end working example project that demonstrates the functionality available in debinate
.
The temp dir created during deb generation is never deleted, which can lead to a full hard drive. It would be helpful if debinate cleaned up after itself, since it's easier than the calling process trying to find out what the temp dir was named. 💩
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.