Skip to content

Instantly share code, notes, and snippets.

@qwcode
qwcode / gist:8431828
Last active July 5, 2023 08:55
"Pypa Standard Docs Template"

A basic structure for Pypa project docs

why a consistent structure? in large part for making the "Python Packaging User Guide" more effective when linking and less redundant

All the projects should use the default RTD theme to match the User Guide.

Introduction

@qwcode
qwcode / gist:6040828
Created July 19, 2013 17:17
vendor pkg_resources/setuptools analysis

3 problems to be solved:

  1. making pip a self-sufficient wheel installer
  2. removing the headache of users being responsible for managing the setuptools build dependency themselves (most notably a pain in non-virtualenv environments),
  3. the burden/fragility of supporting any pip version with any setuptools version.

solutions for #1:

  1. vendor pkg_resources
  2. emulate pkg_resources using the already vendored distlib (#909 )
@qwcode
qwcode / remote_requirements.txt
Created April 13, 2013 03:40
remote requirments test
# a comment
virtualenv myVE
source myVE/bin/activate
cd myproject
pip -e .[testing] #installs project into myVE in develop mode with dependencies and the testing extras
pip install somepkg #install something else you want to try
Synopsis:
pip install [options] <package> [<package> ...]
General Options:
-V, --version
show version and exit
Usage: pip COMMAND [OPTIONS]
Commands:
bundle Create pybundles (archives containing multiple packages)
freeze Output all currently installed packages (exact versions) to stdout
help Show available commands
install Install packages
search Search PyPI
show Output installed distributions (exact versions, files) to stdout
uninstall Uninstall packages
@qwcode
qwcode / gist:3828762
Created October 3, 2012 18:20
--package-cache
"--package-cache"
- a new "pip install" config option that offers name-based (i.e. not url-based) caching.
- the "--download-cache" option would stay as it is, and not be altered
- the package-cache dir would just contain packages (e.g. "nose-1.2.tar.gz", or lxml-2.5[..].whl), anything you've installed while using it.
- the package-cache would be turned off by default, since the user assumes a certain amount of risk/responsibility in using it (no hash checking)
- the package-cache (if turned on) would be checked prior to using the PackageFinder (which searches pypi and findlinks)
(if the req was "nose", any nose version in the package-cache would "win", unless --upgrade is specified)
- package-cache offers an alternative to this workflow:
- pip install -d DIR PACKAGES
@qwcode
qwcode / gist:3828683
Created October 3, 2012 18:07
"pip wheel"
Usage: pip wheel [OPTIONS] PACKAGE_NAMES...
Creates wheel archives from your requirements and place into ./wheels
(requires distribute>0.6.28 and wheel)
-w --wheel-dir <DIR> //alternative dir to place wheels into
--force-rebuild //rewrite existing wheels
--unpack-only <DIR> //unpack to dir, for manual building with "setup.py bdist_wheel"
-r, --requirement <FILENAME>
-f, --find-links <URL>
@qwcode
qwcode / gist:3088149
Created July 11, 2012 05:14
non-recursive force upgrade

Upgrading a package, w/o upgrading dependencies that are already satisifed

suppose the following packages: a, b, c, d

with the following dependency relationships between their versioned distributions

  • a-1
  • b
@qwcode
qwcode / gist:2993698
Created June 26, 2012 06:12
pip install options breakdown
option Right align Center align
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned