Creating a package installer on OS X - installing Python, NumPy, and other dependencies

I want to create my own package installer for Mac OS X, creating a package is not really a problem, the real deal is the dependencies that need to be installed; I need to install Python, NumPy and Matplotlib (only if the required versions are not already installed).

I heard very badly about the Package Maker app, I read a little and already found a good tutorial, although it's pretty outdated . As a reference, here is the Apple guide link.

I guess I would have to use an unrelated source provided from each of these three projects.

That would really help me see the PackageMaker file that is used to create the official Python installer, if such a file is available somewhere, point it to me.

Anyway:

What would be the best way to do this? Does PackageMaker use stupidly for this purpose? Any other literature that will help me?

Additionally:

What would be the easiest way to check my installers?

+6
source share
3 answers

I assume that you want to install the packages you specify as you are developing a Python application. Have you looked at PyInstaller ? It "converts (packages) Python programs to stand-alone executables for Windows, Linux, Mac OS X, Solaris, and AIX", so you don’t have to worry about what is installed on the target system.

And if you use PyInstaller, "extra" will be easy. Just copy the resulting executable file to any other computer and verify it by executing it.

+3
source

Something like /tmp/install.sh :

 cd ~ curl -C - -O http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.7.tar.gz tar -xzf virtualenv-1.7.tar.gz cd ./virtualenv-1.7 python setup.py install cd ~ rm virtualenv-1.7.tar.gz rm -rd ./virtualenv-1.7 virtualenv myenvfolder source myenvfolder/bin/activate easy_install pip pip install NumPy pip install Matplotlib 

And then:

 chmod +x /tmp/install.sh; /tmp/install.sh 
+2
source

Perhaps you can use macports binary-packages or binary archives ? and possibly a cloth or puppet . Puppet on OSX .

Macports is as easy as apt-get to use and takes care of all the dependencies. By default, macports installs / opt / local, so installations do not interfere with Apple's installation. The default value is to compile from the source. Some packages are large and have many dependencies, so compilation takes a lot of time and all the tools on the machine. If you are creating a binary archive, you only need to compile one of them: arcithecture / osx-version. Then you only need to install macports and set the share with binary archives. With a cloth or puppet, you can automate assembly and distribution.

Then, if you find out in the near future that you need pytable or numexpr, it is as simple as: sudo port install py26-tables and if other people need it, you can make it a binary archive and put it on it.

+1
source

Source: https://habr.com/ru/post/908009/


All Articles