Repository navigation
Expand file tree
/
Copy pathindex.rst
More file actions
8922 lines (6453 loc) · 261 KB
/
Copy pathindex.rst
File metadata and controls
8922 lines (6453 loc) · 261 KB
Edit and raw actions
OlderNewer
1
2
3
.. index:: westurner/tools
4
.. index:: Tools
5
.. _tools:
6
7
================
8
Tools
9
================
10
11
| Docs: https://westurner.github.io/tools/
12
| Src: https://github.com/westurner/tools
13
14
See Also: https://westurner.github.io/wiki/projects#tools
15
16
17
.. index:: Packages
18
.. _packages:
19
20
Packages
21
==========
22
| Wikipedia: `<https://en.wikipedia.org/wiki/Package_(package_management_system)>`__
23
24
A software package is an archive of files
25
with a manifest that lists the files included.
26
Often, the manifest contains file checksums
27
and a *signature*.
28
29
Many packaging tools make a distinction between source
30
and/or binary packages.
31
32
Some packaging tools provide configuration options for:
33
34
* Scripts to run when packaging
35
* Scripts to run at install time
36
* Scripts to run at uninstal time
37
* Patches to apply to the "*vanilla*" source tree,
38
as might be obtained from a version control repository
39
40
There is a package maintainer whose responsibilities include:
41
42
* Testing new *upstream* releases
43
* *Vetting* changes from release to release
44
* *Repackaging* upstream releases
45
* *Signing* new package releases
46
47
*Packaging lag* refers to how long it takes a package maintainer
48
to repackage upstream releases for the target platform(s).
49
50
51
.. index:: Anaconda
52
.. _anaconda:
53
54
Anaconda
55
~~~~~~~~~~
56
| Wikipedia: `<https://en.wikipedia.org/wiki/Anaconda_(Python_distribution)>`__
57
| Homepage: https://store.continuum.io/cshop/anaconda/
58
| Docs: https://docs.continuum.io/anaconda/
59
60
Anaconda is a maintained distribution of :ref:`Conda`
61
packages for many languages; especially :ref:`Python`.
62
63
.. note:: `<https://en.wikipedia.org/wiki/Anaconda_(installer)>`__ (1999)
64
is the installer for :ref:`RPM`-based :ref:`Linux` distributions; which is
65
also written in :ref:`Python` (and :ref:`C`).
66
67
68
.. index:: APT
69
.. _apt:
70
71
APT
72
~~~~~~~~~~~~~
73
| Wikipedia: `<https://en.wikipedia.org/wiki/Advanced_Packaging_Tool>`_
74
| Homepage: https://alioth.debian.org/projects/apt
75
| Docs: https://wiki.debian.org/Apt
76
| Docs: https://www.debian.org/doc/manuals/debian-reference/ch02.en.html
77
| Docs: https://www.debian.org/doc/manuals/apt-howto/
78
| Docs: https://wiki.debian.org/SecureApt
79
| Src: git git://anonscm.debian.org/git/apt/apt.git
80
| IRC: `<irc://irc.debian.org/debian-apt>`__
81
82
83
APT ("Advanced Packaging Tool") is the core of :ref:`Debian`
84
package management.
85
86
* An APT package repository serves :ref:`DEB` packages created with :ref:`Dpkg`.
87
88
* An APT package repository can be accessed from a local filesystem
89
or over a network protocol ("apt transports") like HTTP, HTTPS, RSYNC, FTP,
90
and BitTorrent (`debtorrent`).
91
92
An example of APT usage
93
(e.g. to maintain an updated :ref:`Ubuntu` :ref:`Linux` system):
94
95
.. code-block:: bash
96
97
apt-get update
98
apt-get upgrade
99
apt-get dist-upgrade
100
101
apt-cache show bash
102
apt-get install bash
103
104
apt-get --help
105
man apt-get
106
man sources.list
107
108
109
.. index:: AUR
110
.. _aur:
111
112
AUR
113
~~~~
114
| Wikipedia: https://en.wikipedia.org/wiki/Arch_Linux#Arch_User_Repository_.28AUR.29
115
116
AUR (:ref:`Arch` *User Repository*) contains :ref:`PKGBUILD`
117
packages which can be installed by :ref:`pacman`.
118
119
120
.. index:: Bower
121
.. _bower:
122
123
Bower
124
~~~~~~~
125
| Wikipedia: `<https://en.wikipedia.org/wiki/Bower_(software)>`__
126
| Homepage: https://www.bower.io/
127
| Src: https://github.com/bower/bower
128
129
130
Bower is "a package manager for the web" (:ref:`Javascript` packages)
131
built on :ref:`NPM`.
132
133
134
.. index:: BUILD
135
.. _build:
136
137
BUILD
138
~~~~~~
139
| Docs: https://pantsbuild.github.io/build_files.html
140
| Docs: https://pantsbuild.github.io/build_dictionary.html
141
| Docs: https://pantsbuild.github.io/options_reference.html
142
143
A ``BUILD`` file describes a :ref:`Pants Build` build.
144
145
146
.. index:: Cabal
147
.. _cabal:
148
149
Cabal
150
~~~~~~
151
| Homepage: https://www.haskell.org/cabal/
152
| Docs: https://hackage.haskell.org/
153
| Docs: https://www.haskell.org/cabal/users-guide/
154
| Docs: https://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/
155
156
Cabal is a package manager for :ref:`Haskell` packages.
157
158
Hackage is the community Cabal package index: https://hackage.haskell.org/
159
160
161
.. index:: Conda Package
162
.. index:: Conda
163
.. _conda:
164
165
Conda
166
~~~~~~~
167
| Wikipedia: `<https://en.wikipedia.org/wiki/Conda_(package_manager)>`__
168
| Docs: https://conda.io/en/latest/
169
| Src: git https://github.com/conda/conda
170
| PyPI: https://pypi.python.org/pypi/conda
171
172
Conda is a package build, environment, and distribution system
173
written in :ref:`Python`
174
to install packages written in any language.
175
176
* Conda was originally created for the Anaconda Python Distribution,
177
which installs packages written in :ref:`Python`,
178
R,
179
:ref:`Javascript`,
180
:ref:`Ruby`,
181
:ref:`C`,
182
:ref:`Fortran`
183
* Conda packages are basically tar archives with build, and optional
184
link/install and uninstall scripts.
185
* ``conda-build`` generates conda packages from conda recipes
186
with a ``meta.yaml``, a ``build.sh``, and/or a ``build.bat``.
187
* Conda recipes reference and build from
188
a source package URI
189
*OR* a :ref:`VCS <vcs>` URI and revision; and/or custom ``build.sh`` or
190
``build.bat`` scripts.
191
* ``conda skeleton`` can automatically create conda recipes
192
from ``PyPI`` (Python), ``CRAN`` (R), and ``CPAN`` (Perl)
193
* ``conda skeleton``-generated recipes can be updated
194
with additional metadata, scripts, and source URIs
195
(as separate patches or consecutive branch commits
196
of e.g. a conda-recipes repository
197
in order to get a diff of the skeleton recipe and the current recipe).
198
* Conda (and :ref:`Anaconda`) packages are hosted by
199
`<https://binstar.org>`__,
200
which hosts free public and paid private Conda packages.
201
202
* Anaconda Server is an internal
203
"Private, Secure Package Repository"
204
that
205
"supports over 100 different repositories,
206
including PyPI, CRAN, conda, and the Anaconda repository."
207
208
To create a fresh conda env:
209
210
.. code:: bash
211
212
# Python 2.7
213
conda create -n science --yes python readline conda-env
214
215
# Python 3.X
216
conda create -n science3 --yes python=3 readline conda-env
217
218
Work on a conda env:
219
220
.. code:: bash
221
222
source activate exmpl2
223
conda list
224
source deactivate
225
226
227
``conda-env`` writes to and creates environments from ``environment.yml``
228
files which list conda and :ref:`pip` packages.
229
230
Work with conda envs and ``environment.yml`` files:
231
232
.. code:: bash
233
234
# Install conda-env globally (in the "root" conda environment)
235
conda install -n root conda-env
236
237
# Create a conda environment with ``conda-create`` and install conda-env
238
conda create -n science python=3 readline conda-env pip
239
240
# Install some things with conda (and envs/science/bin/pip)
241
# https://github.com/westurner/notebooks/blob/gh-pages/install.sh
242
conda search pandas; conda info pandas
243
conda install blaze dask bokeh odo \
244
sqlalchemy hdf5 h5py \
245
scikit-learn statsmodels \
246
beautiful-soup lxml html5lib pandas qgrid \
247
ipython-notebook
248
pip install -e git+https://github.com/rdflib/rdflib@master#egg=rdflib
249
pip install arrow sarge structlog
250
251
# Export an environment.yml
252
#source deactivate
253
conda env export -n science | tee environment.yml
254
255
# Create an environment from an environment.yml
256
conda env create -n projectname -f ./environment.yml
257
258
To install a conda package from a custom channel:
259
260
- https://www.pydanny.com/building-conda-packages-for-multiple-operating-systems.html
261
- https://github.com/conda/conda-recipes/tree/master/cookiecutter
262
- https://binstar.org/pydanny/cookiecutter
263
264
.. code:: bash
265
266
conda install -c pydanny cookiecutter # OR pip install cookiecutter
267
268
The conda-forge custom channel packages are built with :ref:`continuous
269
integration` on multiple platforms:
270
271
* https://conda-forge.github.io/
272
* https://anaconda.org/conda-forge
273
274
Sources:
275
276
* https://github.com/conda
277
* https://github.com/conda/conda -- conda
278
* https://github.com/ContinuumIO/pycosat -- pycosat SAT solver
279
* https://github.com/conda/conda-env -- conda-env
280
(the ``conda env`` command)
281
* https://github.com/conda/conda-build -- conda-build
282
(the ``conda build`` command)
283
* https://github.com/conda/conda-recipes -- Community-maintained
284
conda recipes (which users may build and
285
:ref:`maintain <packages>` in https://binstar.org
286
package repositories)
287
288
289
290
See also: :ref:`Anaconda`, :ref:`conda-forge` (:ref:`conda-smithy`)
291
292
293
.. index:: conda-forge
294
.. _conda-forge:
295
296
conda-forge
297
~~~~~~~~~~~~~~~~~
298
| Homepage: https://conda-forge.github.io/
299
| Src: https://github.com/conda-forge
300
| Src: https://github.com/conda-forge/feedstocks
301
| Src: https://github.com/conda-forge/feedstocks/tree/master/feedstocks
302
| Src: https://github.com/conda-forge/staged-recipes
303
| DockerHub: https://hub.docker.com/r/condaforge/linux-anvil
304
| Docs: https://conda-forge.github.io/docs/
305
| Docs: https://conda-forge.github.io/docs/recipe.html
306
307
* https://conda-forge.github.io/#add_recipe
308
309
* A. fork: https://github.com/conda-forge/staged-recipes
310
311
* meta.yaml https://github.com/conda-forge/staged-recipes/blob/master/recipes/example/meta.yaml
312
313
* B. conda-smithy
314
315
* meta.yaml
316
317
* Docs: numpy x.x: https://conda-forge.github.io/docs/meta.html#building-against-numpy
318
319
* circle.yml
320
321
* https://github.com/conda-forge/staged-recipes/blob/master/circle.yml
322
323
* .travis.yml
324
325
* https://github.com/conda-forge/staged-recipes/blob/master/.travis.yml
326
327
* appveyor.yml
328
329
* https://github.com/conda-forge/staged-recipes/blob/master/appveyor.yml
330
331
* conda-forge.yml
332
* run_docker_build.sh
333
https://github.com/conda-forge/staged-recipes/blob/master/scripts/run_docker_build.sh
334
* bootstrap-obvious-ci-and-miniconda.py
335
https://github.com/conda-forge/conda-smithy/blob/master/bootstrap-obvious-ci-and-miniconda.py
336
337
.. code:: bash
338
339
# create a conda package recipe from a pypi package
340
cd $VIRTUAL_ENV/src
341
conda skeleton pypi jupyterthemes
342
ls -ld jupyterthemes/
343
edit jupyterthemes/meta.yaml
344
# - git repo tags || pypi releases
345
346
# create a conda-forge feedstock from a conda recipe
347
## https://github.com/conda-forge/conda-smithy#making-a-new-feedstock
348
cd $VIRTUAL_ENV/src
349
ls -ld jupyterthemes
350
conda-smithy init jupyterhemes
351
ls jupyterthemes-feedstock/
352
353
# build a conda-forge feedstock with docker
354
# FROM condaforge/linux-anvil
355
cat ./scripts/run_docker_build.sh
356
./scripts/run_docker_build.sh
357
./ci_support/run_docker_build.sh
358
359
360
.. index:: conda-smithy
361
.. _conda-smithy:
362
363
conda-smithy
364
~~~~~~~~~~~~~~
365
| Src: https://github.com/conda-forge/conda-smithy
366
| Docs: https://github.com/conda-forge/conda-smithy#making-a-new-feedstock
367
368
369
.. index:: DEB
370
.. _deb:
371
372
DEB
373
~~~~~
374
| Wikipedia: `<https://en.wikipedia.org/wiki/Deb_(file_format)>`__
375
376
377
DEB is the :ref:`Debian` software package format.
378
379
DEB packages are built with :ref:`dpkg` and often hosted in an :ref:`APT`
380
package repository.
381
382
.. index:: Dpkg
383
.. _dpkg:
384
385
Dpkg
386
~~~~~~~~~~~~~~
387
| Wikipedia: `<https://en.wikipedia.org/wiki/Dpkg>`_
388
| Homepage: https://wiki.debian.org/Teams/Dpkg
389
| Docs: `<https://en.wikipedia.org/wiki/Debian_build_toolchain>`_
390
| Docs: https://www.debian.org/doc/manuals/debian-faq/ch-pkg_basics.en.html
391
| Docs: https://www.debian.org/doc/manuals/debian-faq/ch-pkgtools.en.html
392
| Docs:
393
394
395
Dpkg is a collection of tools for creating and working with
396
:ref:`DEB` packages.
397
398
399
.. index:: dnf
400
.. _dnf:
401
402
dnf
403
~~~~~
404
| Wikipedia: `<https://en.wikipedia.org/wiki/DNF_(software)>`__
405
| Homepage: https://fedoraproject.org/wiki/DNF
406
| Homepage: https://fedoraproject.org/wiki/Features/DNF
407
| Src: git https://github.com/rpm-software-management/dnf
408
| Docs: https://dnf.readthedocs.io/en/latest/
409
| Docs: https://github.com/rpm-software-management/dnf/wiki
410
| Docs: https://rpm-software-management.github.io/dnf-plugins-core/
411
412
dnf is a an open source package manager written in :ref:`Python`.
413
414
* dnf was introduced in :ref:`Fedora` 18.
415
* dnf is the default package manager in :ref:`Fedora` 22;
416
replacing :ref:`yum`.
417
418
* [ ] ``yum`` errors if TODO package is installed (* :ref:`salt`
419
provider)
420
* [ ] ``repoquery`` redirects with an error to ``dnf repoquery``
421
* See ``dnf help`` (and ``man dnf``)
422
423
* dnf integrates with the Anaconda system installer.
424
* :ref:`dnf` supports **Delta** RPM packages (DRPM),
425
which often significantly reduce the required amount of network
426
transfer required to regularly retrieve and upgrade to
427
the latest repository packages.
428
429
430
.. index:: ebuild
431
.. _ebuild:
432
433
ebuild
434
~~~~~~~~
435
| Wikipedia: https://en.wikipedia.org/wiki/Ebuild
436
| Homepage: https://wiki.gentoo.org/wiki/Ebuild
437
| Docs: https://devmanual.gentoo.org/quickstart/
438
| Docs: https://devmanual.gentoo.org/ebuild-writing/
439
| Docs: https://devmanual.gentoo.org/ebuild-writing/file-format/
440
| Docs: https://devmanual.gentoo.org/ebuild-writing/variables/
441
| Docs: https://devmanual.gentoo.org/ebuild-writing/use-conditional-code/
442
| Docs: https://wiki.gentoo.org/wiki/Submitting_ebuilds
443
444
ebuild is a software package definition format.
445
446
* ebuilds are like special :ref:`bash` scripts.
447
* ebuilds have ``USE`` flags for specifying build features.
448
* :ref:`Gentoo` is built from ebuild package definitions
449
stored in Gentoo :ref:`Portage`.
450
* :ref:`Portage` packages are built from ebuilds.
451
* The :ref:`emerge` :ref:`Portage` command installs ebuilds.
452
453
454
.. index:: emerge
455
.. _emerge:
456
457
emerge
458
~~~~~~~~
459
| Wikipedia: `<https://en.wikipedia.org/wiki/Portage_(software)#Emerge>`__
460
| Homepage: https://wiki.gentoo.org/wiki/Portage#emerge
461
| Src: git https://github.com/gentoo/portage
462
| Docs: https://wiki.gentoo.org/wiki/Project:Package_Manager_Specification
463
| Docs: https://projects.gentoo.org/pms/6/pms.html
464
465
``emerge`` is the primary CLI tool used for installing
466
packages built from :ref:`ebuilds <ebuild>` [from :ref:`Portage`].
467
468
469
.. index:: fpm
470
.. _fpm:
471
472
fpm
473
~~~~~
474
| Wikipedia:
475
| Src: https://github.com/jordansissel/fpm
476
| Docs: https://github.com/jordansissel/fpm/wiki/
477
| Docs: https://github.com/jordansissel/fpm/wiki/PackageMakeInstall
478
479
fpm (*effing package management*) is a tool for building many types
480
of software packages from many other types of software packages
481
(e.g. :ref:`DEB`. :ref:`RPM`, :ref:`Python Packages`);
482
often more easily than working with the actual package manager.
483
484
* fpm package source types include: dir rpm gem python empty tar deb cpan npm osxpkg pear pkgin virtualenv zip.
485
* fpm target package types include: rpm deb solaris puppet dir osxpkg p5p puppet sh tar zip
486
487
488
.. index:: Brew
489
.. index:: Homebrew
490
.. _homebrew:
491
492
Homebrew
493
~~~~~~~~~~
494
| Wikipedia: `<https://en.wikipedia.org/wiki/Homebrew_(package_management_software)>`__
495
| Homepage: https://brew.sh/
496
| Src: https://github.com/Homebrew/brew
497
498
Homebrew is a package manager (``brew``) for :ref:`OSX`.
499
500
501
.. index:: NPM
502
.. index:: Node Package Manager
503
.. _npm:
504
505
NPM
506
~~~~
507
| Wikipedia: `<https://en.wikipedia.org/wiki/Npm_(software)>`__
508
| Homepage: https://www.npmjs.org/
509
| Src: https://github.com/npm/npm
510
| Docs: https://docs.npmjs.com/files/package.json#files
511
512
NPM is a :ref:`Javascript` package manager created for :ref:`Node.js`.
513
514
* an NPM package is defined by a ``package.json`` :ref:`JSON` file.
515
* NPM packages are installed with the ``npm`` CLI utility.
516
* :ref:`Bower` builds upon NPM.
517
518
519
.. index:: NuGet
520
.. _nuget:
521
522
NuGet
523
~~~~~~
524
| Wikipedia: https://en.wikipedia.org/wiki/NuGet
525
| Homepage: https://www.nuget.org/
526
527
NuGet is an open source package manager for :ref:`Windows`.
528
529
* Chocolatey maintains variously updated packages
530
for various windows programs:
531
https://chocolatey.org/
532
533
+ An example list of Chocolatey NuGet packages as a :ref:`PowerShell` script:
534
https://gist.github.com/westurner/10950476
535
536
537
538
.. index:: pacman
539
.. _pacman:
540
541
pacman
542
~~~~~~~~
543
| Wikipedia: https://en.wikipedia.org/wiki/Arch_Linux#Pacman
544
| Homepage: https://www.archlinux.org/pacman/
545
| Docs: https://wiki.archlinux.org/index.php/Pacman
546
547
Pacman is an open source package manager which installs
548
``.pkg.tar.xz`` files for :ref:`Arch` Linux.
549
550
551
.. index:: PEX
552
.. _pex:
553
554
PEX
555
~~~~~
556
| Homepage: https://pex.readthedocs.io/
557
| Src: https://github.com/pantsbuild/pex
558
| PyPI: https://pypi.python.org/pypi/pex
559
| Docs: https://pex.readthedocs.io/en/stable/
560
561
PEX (*Python Executable*) is a :ref:`ZIP`-based software package archive
562
format with an executable header.
563
564
* :ref:`Pants` creates PEX packages.
565
566
567
.. index:: PKGBUILD
568
.. _pkgbuild:
569
570
PKGBUILD
571
~~~~~~~~~~
572
| Homepage: https://wiki.archlinux.org/index.php/PKGBUILD
573
| Docs: https://www.archlinux.org/pacman/PKGBUILD.5.html
574
| Docs: https://wiki.archlinux.org/index.php/Makepkg
575
| Docs: https://wiki.archlinux.org/index.php/Creating_packages
576
577
PKGBUILD is a shell script containing the build information
578
for an :ref:`AUR` :ref:`Arch` :ref:`linux` software package.
579
580
581
.. index:: Portage
582
.. _portage:
583
584
Portage
585
~~~~~~~~~
586
| Wikipedia: `<https://en.wikipedia.org/wiki/Portage_(software)>`__
587
| Homepage: https://wiki.gentoo.org/wiki/Project:Portage
588
| Docs: https://wiki.gentoo.org/wiki/Project:Package_Manager_Specification
589
| Docs: https://projects.gentoo.org/pms/6/pms.html
590
591
Portage is a package management and repository system
592
written in :ref:`Python` initially just for :ref:`Gentoo` :ref:`Linux`.
593
594
* :ref:`Emerge` installs :ref:`ebuilds <ebuild>` from :ref:`portage`.
595
596
597
.. index:: Ports
598
.. _ports:
599
600
Ports
601
~~~~~~~
602
| Wikipedia: https://en.wikipedia.org/wiki/Ports_collection
603
| Homepage: https://www.freebsd.org/ports/
604
605
606
A Ports collection contains *Sources* (e.g. archived releases and patch
607
sets)
608
and :ref:`Makefiles <make>`
609
designed to compile software :ref:`packages`
610
for particular :ref:`operating systems <operating system>`
611
distributions' kernel and standard libraries
612
usually for a particular platform.
613
614
615
.. index:: RPM
616
.. _rpm:
617
618
RPM
619
~~~~~
620
| Wikipedia: https://en.wikipedia.org/wiki/RPM_Package_Manager
621
622
RPM (*RPM Package Manager*, :ref:`RedHat` *Package Manager*)
623
is a :ref:`package` format and a set of commandline utilities
624
written in :ref:`C` and :ref:`Perl`.
625
626
* RPM packages can be installed with ``rpm``,
627
:ref:`yum`, :ref:`dnf`.
628
* RPM pacage can be built with tools like ``rpmbuild`` and ``fpm``
629
* Python packages can be built into RPM packages with
630
:ref:`setuptools' <setuptools>` ``bdist_rpm``, ``fpm``
631
* List contents of RPM packages (archives) with e.g. ``less`` and
632
``lesspipe``::
633
634
less ~/path/to/local.rpm # requires lesspipe to be configured
635
636
* RPM Packages are served by and retrieved from
637
repositories by tools like :ref:`yum` and :ref:`dnf`:
638
639
* Local: directories of :ref:`RPM` packages and metadata
640
* Network: :ref:`HTTP <http->`, :ref:`HTTPS <https-->`, :ref:`RSYNC`, FTP
641
* :ref:`dnf` supports **Delta** RPM packages (DRPM),
642
which often significantly reduce the required amount of network
643
transfer required to regularly retrieve and upgrade to
644
the latest repository packages.
645
646
.. note:: There's not yet a :ref:`debtorrent` for
647
:ref:`RPM`, :ref:`YUM`, :ref:`DNF`.
648
649
650
.. index:: Egg
651
.. index:: Python Egg
652
.. index:: Python Packages
653
.. _python packages:
654
655
Python Packages
656
~~~~~~~~~~~~~~~~~~~~~~~~
657
| Homepage: https://pypi.python.org/pypi
658
| Download: https://pypi.python.org/simple/
659
| Docs: https://packaging.python.org/en/latest/
660
| Docs: https://packaging.python.org/en/latest/current/
661
| Docs: https://packaging.python.org/en/latest/distributing/
662
| Docs: https://packaging.python.org/en/latest/peps.html
663
| Docs: https://packaging.python.org/en/latest/projects.html
664
| Docs: https://packaging.python.org/en/latest/specifications/
665
| Docs: https://pypaio.readthedocs.io/en/latest/roadmap/
666
667
A :ref:`Python` Package is a collection of source code and package data files.
668
669
* Python packages have dependencies: they depend on other packages
670
* Python packages can be served from a package index
671
* :ref:`PyPI` is the community Python Package Index
672
* A Python package is an archive of files
673
(``.zip`` (``.egg``, ``.whl``), ``.tar``, ``.tar.gz``,)
674
containing a ``setup.py`` file
675
containing a version string and metadata that is meant for distribution.
676
* An source dist (``sdist``) package contains source code
677
(every file listed in or matching a pattern in a ``MANIFEST.in`` text file).
678
* A binary dist (``bdist``, ``bdist_egg``, ``bdist_wheel``)
679
is derived from an sdist and may be compiled and named
680
for a specific platform.
681
* sdists and bdists are defined by a ``setup.py`` file
682
which contains a call to a
683
``distutils.setup()`` or ``setuptools.setup()`` function.
684
* The arguments to the ``setup.py`` function are things like
685
``version``, ``author``, ``author_email``, and ``homepage``;
686
in addition to package dependency strings required for the package to work
687
(``install_requires``), for tests to run (``tests_require``),
688
and for optional things to work (``extras_require``).
689
* A package dependency string can specify an exact version (``==``)
690
or a greater-than (``>=``) or less-than (``<=``) requirement
691
for each package.
692
* Package names are looked up from an index server (``--index``),
693
such as :ref:`PyPI`,
694
and or an HTML page (``--find-links``) containing URLs
695
containing package names, version strings, and platform strings.
696
* ``easy_install`` (:ref:`setuptools`) and :ref:`pip` can install packages
697
from: the local filesystem, a remote index server, or a local index server.
698
* ``easy_install`` and ``pip`` read the ``install_requires``
699
(and ``extras_require``) attributes of ``setup.py`` files
700
contained in packages in order to resolve a dependency graph
701
(which can contain cycles) and install necessary packages.
702
703
.
704
705
* PyPA Tool Recommendations
706
707
* | Docs: https://packaging.python.org/en/latest/current
708
709
* PyPA Python Package PEPs
710
711
* | Docs: https://packaging.python.org/en/latest/peps.html
712
713
* PyPA Projects List
714
715
* | Docs: https://packaging.python.org/en/latest/projects.html
716
717
718
.. note:: :ref:`JSON-LD-` for package metadata and environment build
719
metadata could be helpful.
720
721
- https://github.com/pypa/interoperability-peps/issues/31
722
723
724
.. index:: distutils
725
.. _distutils:
726
727
Distutils
728
+++++++++
729
| Docs: https://docs.python.org/2/distutils/
730
| Docs: https://docs.python.org/3/distutils/
731
732
Distutils is a collection of tools for common packaging needs.
733
734
* Distutils is included in the :ref:`Python` standard library.
735
736
737
.. index:: setuptools
738
.. _setuptools:
739
740
Setuptools
741
++++++++++++
742
| Wikipedia: https://en.wikipedia.org/wiki/Setuptools
743
| Docs: https://pythonhosted.org/setuptools/
744
| Src: https://github.com/pypa/setuptools
745
| PyPI: https://pypi.python.org/pypi/setuptools
746
747
748
Setuptools is a :ref:`Python package <python packages>` for working with other
749
:ref:`Python Packages`.
750
751
* Setuptools builds upon :ref:`distutils`
752
* Setuptools is widely implemented
753
* Most Python packages are installed by setuptools (by :ref:`Pip`)
754
* Setuptools can be installed by downloading ``ez_setup.py``
755
and then running ``python ez_setup.py``; or,
756
setuptools can be installed with a system package manager (apt, yum)
757
* Setuptools installs a script called ``easy_install`` which can
758
be used to install packages from the local filesystem,
759
a remote index server, a local index server, or an HTML page
760
* ``easy_install pip`` installs :ref:`Pip` from PyPI
761
* Like ``easy_install``, :ref:`Pip` installs python packages,
762
with a number of additional configuration options
763
* Setuptools can build :ref:`RPM` and :ref:`DEB` packages
764
from python packages, with some extra configuration::
765
766
python setup.py bdist_rpm --help
767
python setup.py --command-packages=stdeb.command bdist_deb --help
768
769
770
.. index:: Pip
771
.. _pip:
772
773
Pip
774
++++++++++++++
775
| Wikipedia: `<https://en.wikipedia.org/wiki/Pip_(package_manager)>`_
776
| Homepage: https://pip.pypa.io/
777
| Docs: https://pip.pypa.io/en/latest/user_guide.html
778
| Docs: https://pip.readthedocs.io/en/latest/
779
| Src: git https://github.com/pypa/pip
780
| Pypi: https://pypi.python.org/pypi/pip
781
| IRC: #pypa
782
| IRC: #pypa-dev
783
784
785
Pip is a tool for installing, upgrading, and uninstalling
786
:ref:`Python` packages.
787
788
::
789
790
pip help
791
pip help install
792
pip --version
793
794
sudo apt-get install python-pip
795
pip install --upgrade pip
796
797
pip install libcloud
798
pip install -r requirements.txt
799
pip uninstall libcloud
800
801
802
* Pip stands upon :ref:`distutils` and :ref:`setuptools`.
803
* Pip retrieves, installs, upgrades, and uninstalls packages.
804
* Pip can list installed packages with ``pip freeze`` (and ``pip
805
list``).
806
* Pip can install packages as 'editable' packages (``pip install -e``)
807
from version control repository URLs
808
which must begin with ``vcs+``,
809
end with ``#egg=<usuallythepackagename>``,
810
and may contain an ``@vcstag`` tag
811
(such as a branch name or a version tag).
812
* Pip installs packages as editable by first
813
cloning (or checking out) the code to ``./src``
814
(or ``${VIRTUAL_ENV}/src`` if working in a :ref:`virtualenv`)
815
and then running ``setup.py develop``.
816
* Pip configuration is in ``${HOME}/.pip/pip.conf``.
817
* Pip can maintain a local cache of downloaded packages,
818
which can lessen the load on package servers during testing.
819
* Pip skips reinstallation if a package requirement is already
820
satisfied.
821
* Pip requires the ``--upgrade`` and/or ``--force-reinstall`` options
822
to be added to the ``pip install`` command in order to upgrade
823
or reinstall.
824
* At the time of this writing, the latest stable pip version is
825
``1.5.6``.
826
827
.. warning::
828
With :ref:`Python` 2, pip is preferable to
829
:ref:`setuptools`'s ``easy_install``
830
because pip installs ``backports.ssl_match_hostname``
831
in order to validate ``HTTPS`` certificates
832
(by making sure that the certificate hostname matches the hostname
833
from which the DNS resolved to).
834
835
Cloning packages from source repositories over ``ssh://``
836
or ``https://``,
837
either manually or with ``pip install -e`` avoids this concern.
838
839
There is also a tool called :ref:`peep` which
840
requires considered-good SHA256 checksums to be specified
841
for every dependency listed in a ``requirements.txt`` file.
842
843
For more information, see:
844
https://legacy.python.org/dev/peps/pep-0476/#python-versions
845
846
.. glossary::
847
848
Pip Requirements File
849
Plaintext list of packages and package URIs to install.
850
851
Requirements files may contain version specifiers (``pip >= 1.5``)
852
853
Pip installs Pip Requirement Files::
854
855
pip install -r requirements.txt
856
pip install --upgrade -r requirements.txt
857
pip install --upgrade --user --force-reinstall -r requirements.txt
858
859
An example ``requirements.txt`` file::
860
861
# install pip from the default index (PyPI)
862
pip
863
--index=https://pypi.python.org/simple --upgrade pip
864
865
# Install pip 1.5 or greater from PyPI
866
pip >= 1.5
867
868
# Git clone and install pip as an editable develop egg
869
-e git+https://github.com/pypa/pip@1.5.X#egg=pip
870
871
# Install a source distribution release from PyPI
872
# and check the MD5 checksum in the URL
873
https://pypi.python.org/packages/source/p/pip/pip-1.5.5.tar.gz#md5=7520581ba0687dec1ce85bd15496537b
874
875
# Install a source distribution release from Warehouse
876
https://warehouse.python.org/packages/source/p/pip/pip-1.5.5.tar.gz
877
878
# Install an additional requirements.txt file
879
-r requirements/more-requirements.txt
880
881
.. index:: Peep
882
.. _peep:
883
884
Peep
885
+++++
886
| Src: https://github.com/erikrose/peep
887
| PyPI: https://pypi.python.org/pypi/peep
888
889
890
Peep works just like :ref:`pip`, but requires ``SHA256`` checksum hashes
891
to be specified for each package in ``requirements.txt`` file.
892
893
894
.. index:: Python Package Index
895
.. index:: PyPI
896
.. _pypi:
897
898
PyPI
899
++++++
900
| Wikipedia: https://en.wikipedia.org/wiki/Python_Package_Index
901
| Docs: https://wiki.python.org/moin/CheeseShop
902
| Docs: https://wiki.python.org/moin/CheeseShopDev
903
| Homepage: https://pypi.python.org/pypi
904
| Src: https://github.com/pypa/pypi-legacy
905
906
907
PyPI-legacy is the original Python Package Index.
908
PyPI is now powered by :ref:`Warehouse`
909
910
911
.. index:: Warehouse
912
.. _warehouse:
913
914
Warehouse
915
++++++++++
916
| Homepage: https://warehouse.python.org/
917
| Src: https://github.com/pypa/warehouse
918
| Docs: https://warehouse.readthedocs.io/en/latest/
919
920
921
Warehouse is the "Next Generation Python Package Repository".
922
923
All packages uploaded to :ref:`PyPI` are also available from Warehouse.
924
925
926
.. index:: Devpi
927
.. _devpi:
928
929
Devpi
930
++++++++
931
| Homepage: https://doc.devpi.net/
932
| Src: https://github.com/devpi/devpi
933
| Issues: https://github.com/devpi/devpiissues
934
| PyPI: https://pypi.python.org/pypi/devpi-server
935
| PyPI: https://pypi.python.org/pypi/devpi-web
936
| PyPI: https://pypi.python.org/pypi/devpi-client
937
| Docs: https://doc.devpi.net/latest/
938
939
Devpi is a server and client solution for :ref:`Python package <python
940
packages>` mirroring, hosting, and testing.
941
942
943
.. index:: Python Wheel
944
.. index:: Wheel
945
.. _wheel:
946
947
Wheel
948
++++++
949
| Docs: https://legacy.python.org/dev/peps/pep-0427/
950
| Docs: https://wheel.readthedocs.io/en/latest/
951
| Src: https://github.com/pypa/wheel
952
| PyPI: https://pypi.python.org/pypi/wheel
953
954
955
* Wheel is a newer, PEP-based standard (``.whl``) with a different
956
metadata format, the ability to specify (JSON) digital signatures
957
for a package within the package, and a number
958
of additional speed and platform-consistency advantages.
959
* Wheels can be uploaded to PyPI.
960
* Wheels are generally faster than traditional Python packages.
961
962
Packages available as wheels are listed at `<https://pythonwheels.com/>`__.
963
964
965
.. index:: Ruby Gem
966
.. index:: RubyGems
967
.. _rubygems:
968
969
RubyGems
970
~~~~~~~~~
971
| Wikipedia: https://en.wikipedia.org/wiki/RubyGems
972
| Homepage: https://rubygems.org/
973
| Docs: https://guides.rubygems.org/
974
| Src: https://github.com/rubygems/rubygems
975
976
RubyGems is a package manager for :ref:`Ruby` packages ("Gems").
977
978
979
.. index:: Yum
980
.. _yum:
981
982
Yum
983
~~~~~
984
| Wikipedia: https://en.wikipedia.org/wiki/Yellowdog_Updater,_Modified
985
| Homepage: http://yum.baseurl.org/
986
987
988
Yum is a tool for installing, upgrading, and uninstalling :ref:`RPM`
989
packages.
990
991
992
.. index:: Version Control Systems
993
.. index:: Distributed Version Control Systems
994
.. _vcs:
995
996
Version Control Systems
997
========================
998
| Wikipedia: https://en.wikipedia.org/wiki/Revision_control
999
| Wikipedia: https://en.wikipedia.org/wiki/Distributed_revision_control
1000