summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndřej Nový <onovy@debian.org>2018-04-06 14:33:35 +0200
committerOndřej Nový <onovy@debian.org>2018-04-06 14:33:35 +0200
commitbc9a847c9fd17500de84ba0076125f6553ffd0ab (patch)
tree58336e8030687aac0dd97782c6eba4e45e7085e3
parent968d13f8db0ab2bc8d37036820139c73c9e101d2 (diff)
Import python-py_1.5.3.orig.tar.gz
-rw-r--r--.gitattributes1
-rw-r--r--.gitignore12
-rw-r--r--.hgignore29
-rw-r--r--.hgtags68
-rw-r--r--.travis.yml27
-rw-r--r--CHANGELOG9
-rw-r--r--PKG-INFO3
-rw-r--r--bench/localpath.py75
-rw-r--r--py.egg-info/PKG-INFO3
-rw-r--r--py.egg-info/SOURCES.txt22
-rw-r--r--py/__init__.py9
-rw-r--r--py/_path/local.py2
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst87
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER1
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/METADATA109
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/RECORD9
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/WHEEL6
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/metadata.json1
-rw-r--r--py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt1
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/DESCRIPTION.rst53
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/INSTALLER1
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/METADATA78
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/RECORD9
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/WHEEL5
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/metadata.json1
-rw-r--r--py/_vendored_packages/iniconfig-1.0.0.dist-info/top_level.txt1
-rw-r--r--tasks/__init__.py12
-rw-r--r--tasks/vendoring.py23
-rw-r--r--testing/root/test_error.py14
-rw-r--r--tox.ini12
30 files changed, 663 insertions, 20 deletions
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..1246879
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1 @@
+*.dump eol=lf
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5bb0d45
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,12 @@
+
+.cache/
+.tox/
+__pycache__/
+
+*.pyc
+*.pyo
+
+*.egg-info
+.eggs/
+
+dist/*
diff --git a/.hgignore b/.hgignore
new file mode 100644
index 0000000..34976da
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,29 @@
+
+# Automatically generated by `hgimportsvn`
+syntax:glob
+.svn
+.hgsvn
+
+# These lines are suggested according to the svn:ignore property
+# Feel free to enable them by uncommenting them
+syntax:glob
+*.pyc
+*.pyo
+*.swp
+*.html
+*.class
+*.orig
+*~
+
+doc/_build
+build/
+dist/
+*.egg-info
+issue/
+env/
+3rdparty/
+.tox
+lib/
+bin/
+include/
+src/
diff --git a/.hgtags b/.hgtags
new file mode 100644
index 0000000..9d48095
--- /dev/null
+++ b/.hgtags
@@ -0,0 +1,68 @@
+52c6d9e78777a5a34e813123997dfc614a1a4767 1.0.0b3
+1c7aaa8c61f3b0945921a9acc7beb184201aed4b 1.0.0b4
+1c7aaa8c61f3b0945921a9acc7beb184201aed4b 1.0.0b4
+0000000000000000000000000000000000000000 1.0.0b4
+0000000000000000000000000000000000000000 1.0.0b4
+8cd6eb91eba313b012d6e568f37d844dc0751f2e 1.0.0b4
+8cd6eb91eba313b012d6e568f37d844dc0751f2e 1.0.0b4
+0000000000000000000000000000000000000000 1.0.0b4
+2cc0507f117ffe721dff7ee026648cfce00ec92f 1.0.0b6
+86f1e1b6e49bf5882a809f11edd1dbb08162cdad 1.0.0b8
+86f1e1b6e49bf5882a809f11edd1dbb08162cdad 1.0.0b8
+c63f35c266cbb26dad6b87b5e115d65685adf448 1.0.0b8
+c63f35c266cbb26dad6b87b5e115d65685adf448 1.0.0b8
+0eaa0fdf2ba0163cf534dc2eff4ba2e5fc66c261 1.0.0b8
+e2a60653cb490aeed81bbbd83c070b99401c211c 1.0.0b9
+5ea0cdf7854c3d4278d36eda94a2b68483a0e211 1.0.0
+5ea0cdf7854c3d4278d36eda94a2b68483a0e211 1.0.0
+7acde360d94b6a2690ce3d03ff39301da84c0a2b 1.0.0
+6bd221981ac99103002c1cb94fede400d23a96a1 1.0.1
+4816e8b80602a3fd3a0a120333ad85fbe7d8bab4 1.0.2
+60c44bdbf093285dc69d5462d4dbb4acad325ca6 1.1.0
+319187fcda66714c5eb1353492babeec3d3c826f 1.1.1
+4fc5212f7626a56b9eb6437b5c673f56dd7eb942 1.2.0
+c143a8c8840a1c68570890c8ac6165bbf92fd3c6 1.2.1
+eafd3c256e8732dfb0a4d49d051b5b4339858926 1.3.0
+d5eacf390af74553227122b85e20345d47b2f9e6 1.3.1
+d5eacf390af74553227122b85e20345d47b2f9e6 1.3.1
+8b8e7c25a13cf863f01b2dd955978285ae9daf6a 1.3.1
+3bff44b188a7ec1af328d977b9d39b6757bb38df 1.3.2
+c59d3fa8681a5b5966b8375b16fccd64a3a8dbeb 1.3.3
+79ef6377705184c55633d456832eea318fedcf61 1.3.4
+79ef6377705184c55633d456832eea318fedcf61 1.3.4
+90fffd35373e9f125af233f78b19416f0938d841 1.3.4
+5346ab41b059c95a48cbe1e8a7bae96ce6e0da27 1.4.0
+1f3125cba7976538952be268f107c1d0c36c5ce8 1.4.1
+04ab22db4ff737cf31e91d75a0f5d7077f324167 1.4.2
+9950bf9d684a984d511795013421c89c5cf88bef 1.4.3
+d9951e3bdbc765e73835ae13012f6a074d13d8bf 1.4.4
+b827dd156a36753e32c7f3f15ce82d6fe9e356c8 1.4.6
+f15726f9e5a67cc6221c499affa4840e9d591763 1.4.7
+abfabd07a1d328f13c730e8a50d80d2e470afd3b 1.4.9
+7f37ee0aff9be4b839d6759cfee336f60e8393a4 1.4.10
+fe4593263efa10ea7ba014db6e3379e0b82368a2 1.4.11
+f07af25a26786e4825b5170e17ad693245cb3426 1.4.12
+d3730d84ba7eda92fd3469a3f63fd6d8cb22c975 1.4.13
+12c1ae8e7c5345721e9ec9f8e27b1e36c07f74dc 1.4.14
+12c1ae8e7c5345721e9ec9f8e27b1e36c07f74dc 1.4.14
+0000000000000000000000000000000000000000 1.4.14
+0000000000000000000000000000000000000000 1.4.14
+1497e2efd0f8c73a0e3d529debf0c489e4cd6cab 1.4.14
+e065014c1ce8ad110a381e9baaaa5d647ba7ac6b 1.4.15
+e9e5b38f53dc35b35aa1f9ee9a9be9bbd2d2c3b1 1.4.16
+c603503945f52b78522d96a423605cbc953236d3 1.4.17
+c59201105a29801cc858eb9160b7a19791b91a35 1.4.18
+284cc172e294d48edc840012e1451c32c3963d92 1.4.19
+a3e0626aa0c5aecf271367dc77e476ab216ea3c8 1.4.20
+5e48016c4a3af8e7358a1267d33d021e71765bed 1.4.21
+01ae2cfcc61c4fcb3aa5031349adb5b467c31018 1.4.23
+5ffd982f4dff60b588f309cd9bdc61036547282a 1.4.24
+dc9ffbcaf1f7d72e96be3f68c11deebb7e7193c5 1.4.25
+6de1a44bf75de7af4fcae947c235e9072bbdbb9a 1.4.26
+7d650ba2657890a2253c8c4a83f170febebd90fa 1.4.27
+7d650ba2657890a2253c8c4a83f170febebd90fa 1.4.27
+1810003dec63dd1b506a23849861fffa5bc3ba13 1.4.27
+ba08706f08ddea1b77a426f00dfe2bdc244345e8 1.4.28
+4e8054ada63f3327bcf759ae7cd36c7c8652bc9b 1.4.29
+366ab346610c6de8aaa7617e24011794b40236c6 1.4.30
+657380e439f9b7e04918cb162cb2e46388244b42 1.4.31
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..917c59d
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,27 @@
+sudo: false
+language: python
+python:
+- '2.7'
+- '3.4'
+- '3.5'
+- '3.6'
+- 'pypy-5.4'
+env:
+- DEPS="pytest~=2.9.0"
+- DEPS="pytest~=3.0.0"
+#- DEPS="pytest~=3.1.0"
+
+matrix:
+
+ include:
+ - python: '2.7'
+ # using a different option due to pytest-addopts pytester issues
+ env: PYTEST_XADDOPTS="-n 3 --runslowtests" DEPS="pytest~=3.0.0 pytest-xdist"
+ allow_failures:
+ - python: 'pypy-5.4'
+install:
+- pip install -U setuptools setuptools_scm
+- pip install $DEPS
+- pip install -U . --force-reinstall
+script:
+- py.test --lsof $PYTEST_XADDOPTS
diff --git a/CHANGELOG b/CHANGELOG
index a3e4bf1..d033f0e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,8 @@
+1.5.3 (unreleased)
+==================
+
+- fix #179: ensure we can support 'from py.error import ...'
+
1.5.2
=====
@@ -11,6 +16,10 @@
1.5.0
=====
+NOTE: **this release has been removed from PyPI** due to missing package
+metadata which caused a number of problems to py26 and py33 users.
+This issue was fixed in the 1.5.1 release.
+
- python 2.6 and 3.3 are no longer supported
- deprecate py.std and remove all internal uses
- fix #73 turn py.error into an actual module
diff --git a/PKG-INFO b/PKG-INFO
index 137f6dc..0e5eb03 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,11 @@
Metadata-Version: 1.2
Name: py
-Version: 1.5.2
+Version: 1.5.3
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Home-page: http://py.readthedocs.io/
Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others
Author-email: pytest-dev@python.org
License: MIT license
-Description-Content-Type: UNKNOWN
Description: .. image:: https://img.shields.io/pypi/v/py.svg
:target: https://pypi.org/project/py
diff --git a/bench/localpath.py b/bench/localpath.py
new file mode 100644
index 0000000..ad4fbd8
--- /dev/null
+++ b/bench/localpath.py
@@ -0,0 +1,75 @@
+
+import py
+import timeit
+
+class Listdir:
+ numiter = 100000
+ numentries = 100
+
+ def setup(self):
+ tmpdir = py.path.local.make_numbered_dir(self.__class__.__name__)
+ for i in range(self.numentries):
+ tmpdir.join(str(i))
+ self.tmpdir = tmpdir
+
+ def run(self):
+ return self.tmpdir.listdir()
+
+class Listdir_arg(Listdir):
+ numiter = 100000
+ numentries = 100
+
+ def run(self):
+ return self.tmpdir.listdir("47")
+
+class Join_onearg(Listdir):
+ def run(self):
+ self.tmpdir.join("17")
+ self.tmpdir.join("18")
+ self.tmpdir.join("19")
+
+class Join_multi(Listdir):
+ def run(self):
+ self.tmpdir.join("a", "b")
+ self.tmpdir.join("a", "b", "c")
+ self.tmpdir.join("a", "b", "c", "d")
+
+class Check(Listdir):
+ def run(self):
+ self.tmpdir.check()
+ self.tmpdir.check()
+ self.tmpdir.check()
+
+class CheckDir(Listdir):
+ def run(self):
+ self.tmpdir.check(dir=1)
+ self.tmpdir.check(dir=1)
+ assert not self.tmpdir.check(dir=0)
+
+class CheckDir2(Listdir):
+ def run(self):
+ self.tmpdir.stat().isdir()
+ self.tmpdir.stat().isdir()
+ assert self.tmpdir.stat().isdir()
+
+class CheckFile(Listdir):
+ def run(self):
+ self.tmpdir.check(file=1)
+ assert not self.tmpdir.check(file=1)
+ assert self.tmpdir.check(file=0)
+
+if __name__ == "__main__":
+ import time
+ for cls in [Listdir, Listdir_arg,
+ Join_onearg, Join_multi,
+ Check, CheckDir, CheckDir2, CheckFile,]:
+
+ inst = cls()
+ inst.setup()
+ now = time.time()
+ for i in xrange(cls.numiter):
+ inst.run()
+ elapsed = time.time() - now
+ print "%s: %d loops took %.2f seconds, per call %.6f" %(
+ cls.__name__,
+ cls.numiter, elapsed, elapsed / cls.numiter)
diff --git a/py.egg-info/PKG-INFO b/py.egg-info/PKG-INFO
index 137f6dc..0e5eb03 100644
--- a/py.egg-info/PKG-INFO
+++ b/py.egg-info/PKG-INFO
@@ -1,12 +1,11 @@
Metadata-Version: 1.2
Name: py
-Version: 1.5.2
+Version: 1.5.3
Summary: library with cross-python path, ini-parsing, io, code, log facilities
Home-page: http://py.readthedocs.io/
Author: holger krekel, Ronny Pfannschmidt, Benjamin Peterson and others
Author-email: pytest-dev@python.org
License: MIT license
-Description-Content-Type: UNKNOWN
Description: .. image:: https://img.shields.io/pypi/v/py.svg
:target: https://pypi.org/project/py
diff --git a/py.egg-info/SOURCES.txt b/py.egg-info/SOURCES.txt
index 588b7c0..d726aac 100644
--- a/py.egg-info/SOURCES.txt
+++ b/py.egg-info/SOURCES.txt
@@ -1,3 +1,8 @@
+.gitattributes
+.gitignore
+.hgignore
+.hgtags
+.travis.yml
AUTHORS
CHANGELOG
LICENSE
@@ -7,6 +12,7 @@ conftest.py
setup.cfg
setup.py
tox.ini
+bench/localpath.py
doc/Makefile
doc/changelog.txt
doc/code.txt
@@ -83,6 +89,22 @@ py/_process/killproc.py
py/_vendored_packages/__init__.py
py/_vendored_packages/apipkg.py
py/_vendored_packages/iniconfig.py
+py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst
+py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER
+py/_vendored_packages/apipkg-1.4.dist-info/METADATA
+py/_vendored_packages/apipkg-1.4.dist-info/RECORD
+py/_vendored_packages/apipkg-1.4.dist-info/WHEEL
+py/_vendored_packages/apipkg-1.4.dist-info/metadata.json
+py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt
+py/_vendored_packages/iniconfig-1.0.0.dist-info/DESCRIPTION.rst
+py/_vendored_packages/iniconfig-1.0.0.dist-info/INSTALLER
+py/_vendored_packages/iniconfig-1.0.0.dist-info/METADATA
+py/_vendored_packages/iniconfig-1.0.0.dist-info/RECORD
+py/_vendored_packages/iniconfig-1.0.0.dist-info/WHEEL
+py/_vendored_packages/iniconfig-1.0.0.dist-info/metadata.json
+py/_vendored_packages/iniconfig-1.0.0.dist-info/top_level.txt
+tasks/__init__.py
+tasks/vendoring.py
testing/conftest.py
testing/code/test_assertion.py
testing/code/test_code.py
diff --git a/py/__init__.py b/py/__init__.py
index b5e0c16..be27e92 100644
--- a/py/__init__.py
+++ b/py/__init__.py
@@ -8,7 +8,7 @@ dictionary or an import path.
(c) Holger Krekel and others, 2004-2014
"""
-__version__ = '1.5.2'
+from py._error import error
try:
from py._vendored_packages import apipkg
@@ -18,15 +18,12 @@ except ImportError:
import apipkg
lib_not_mangled_by_packagers = False
vendor_prefix = ''
+__version__ = '1.5.3'
-# so that py.error.* instances are picklable
-import sys
-apipkg.initpkg(__name__, attr={'_apipkg': apipkg}, exportdefs={
+apipkg.initpkg(__name__, attr={'_apipkg': apipkg, 'error': error}, exportdefs={
# access to all standard lib modules
'std': '._std:std',
- # access to all posix errno's as classes
- 'error': '._error:error',
'_pydir' : '.__metainfo:pydir',
'version': 'py:__version__', # backward compatibility
diff --git a/py/_path/local.py b/py/_path/local.py
index c550fa2..5a785b0 100644
--- a/py/_path/local.py
+++ b/py/_path/local.py
@@ -669,7 +669,7 @@ class LocalPath(FSBase):
mod = sys.modules[modname]
if self.basename == "__init__.py":
return mod # we don't check anything as we might
- # we in a namespace package ... too icky to check
+ # be in a namespace package ... too icky to check
modfile = mod.__file__
if modfile[-4:] in ('.pyc', '.pyo'):
modfile = modfile[:-1]
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst b/py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst
new file mode 100644
index 0000000..5482220
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst
@@ -0,0 +1,87 @@
+Welcome to apipkg!
+------------------------
+
+With apipkg you can control the exported namespace of a
+python package and greatly reduce the number of imports for your users.
+It is a `small pure python module`_ that works on virtually all Python
+versions, including CPython2.3 to Python3.1, Jython and PyPy. It co-operates
+well with Python's ``help()`` system, custom importers (PEP302) and common
+command line completion tools.
+
+Usage is very simple: you can require 'apipkg' as a dependency or you
+can copy paste the <200 Lines of code into your project.
+
+
+Tutorial example
+-------------------
+
+Here is a simple ``mypkg`` package that specifies one namespace
+and exports two objects imported from different modules::
+
+ # mypkg/__init__.py
+ import apipkg
+ apipkg.initpkg(__name__, {
+ 'path': {
+ 'Class1': "_mypkg.somemodule:Class1",
+ 'clsattr': "_mypkg.othermodule:Class2.attr",
+ }
+ }
+
+The package is initialized with a dictionary as namespace.
+
+You need to create a ``_mypkg`` package with a ``somemodule.py``
+and ``othermodule.py`` containing the respective classes.
+The ``_mypkg`` is not special - it's a completely
+regular python package.
+
+Namespace dictionaries contain ``name: value`` mappings
+where the value may be another namespace dictionary or
+a string specifying an import location. On accessing
+an namespace attribute an import will be performed::
+
+ >>> import mypkg
+ >>> mypkg.path
+ <ApiModule 'mypkg.path'>
+ >>> mypkg.path.Class1 # '_mypkg.somemodule' gets imported now
+ <class _mypkg.somemodule.Class1 at 0xb7d428fc>
+ >>> mypkg.path.clsattr # '_mypkg.othermodule' gets imported now
+ 4 # the value of _mypkg.othermodule.Class2.attr
+
+The ``mypkg.path`` namespace and its two entries are
+loaded when they are accessed. This means:
+
+* lazy loading - only what is actually needed is ever loaded
+
+* only the root "mypkg" ever needs to be imported to get
+ access to the complete functionality.
+
+* the underlying modules are also accessible, for example::
+
+ from mypkg.sub import Class1
+
+
+Including apipkg in your package
+--------------------------------------
+
+If you don't want to add an ``apipkg`` dependency to your package you
+can copy the `apipkg.py`_ file somewhere to your own package,
+for example ``_mypkg/apipkg.py`` in the above example. You
+then import the ``initpkg`` function from that new place and
+are good to go.
+
+.. _`small pure python module`:
+.. _`apipkg.py`: http://bitbucket.org/hpk42/apipkg/src/tip/apipkg.py
+
+Feedback?
+-----------------------
+
+If you have questions you are welcome to
+
+* join the #pylib channel on irc.freenode.net
+* subscribe to the http://codespeak.net/mailman/listinfo/py-dev list.
+* create an issue on http://bitbucket.org/hpk42/apipkg/issues
+
+have fun,
+holger krekel
+
+
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER b/py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER
new file mode 100644
index 0000000..a1b589e
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/INSTALLER
@@ -0,0 +1 @@
+pip
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/METADATA b/py/_vendored_packages/apipkg-1.4.dist-info/METADATA
new file mode 100644
index 0000000..eb7e60a
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/METADATA
@@ -0,0 +1,109 @@
+Metadata-Version: 2.0
+Name: apipkg
+Version: 1.4
+Summary: apipkg: namespace control and lazy-import mechanism
+Home-page: http://bitbucket.org/hpk42/apipkg
+Author: holger krekel
+Author-email: holger at merlinux.eu
+License: MIT License
+Platform: unix
+Platform: linux
+Platform: osx
+Platform: cygwin
+Platform: win32
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Programming Language :: Python
+
+Welcome to apipkg!
+------------------------
+
+With apipkg you can control the exported namespace of a
+python package and greatly reduce the number of imports for your users.
+It is a `small pure python module`_ that works on virtually all Python
+versions, including CPython2.3 to Python3.1, Jython and PyPy. It co-operates
+well with Python's ``help()`` system, custom importers (PEP302) and common
+command line completion tools.
+
+Usage is very simple: you can require 'apipkg' as a dependency or you
+can copy paste the <200 Lines of code into your project.
+
+
+Tutorial example
+-------------------
+
+Here is a simple ``mypkg`` package that specifies one namespace
+and exports two objects imported from different modules::
+
+ # mypkg/__init__.py
+ import apipkg
+ apipkg.initpkg(__name__, {
+ 'path': {
+ 'Class1': "_mypkg.somemodule:Class1",
+ 'clsattr': "_mypkg.othermodule:Class2.attr",
+ }
+ }
+
+The package is initialized with a dictionary as namespace.
+
+You need to create a ``_mypkg`` package with a ``somemodule.py``
+and ``othermodule.py`` containing the respective classes.
+The ``_mypkg`` is not special - it's a completely
+regular python package.
+
+Namespace dictionaries contain ``name: value`` mappings
+where the value may be another namespace dictionary or
+a string specifying an import location. On accessing
+an namespace attribute an import will be performed::
+
+ >>> import mypkg
+ >>> mypkg.path
+ <ApiModule 'mypkg.path'>
+ >>> mypkg.path.Class1 # '_mypkg.somemodule' gets imported now
+ <class _mypkg.somemodule.Class1 at 0xb7d428fc>
+ >>> mypkg.path.clsattr # '_mypkg.othermodule' gets imported now
+ 4 # the value of _mypkg.othermodule.Class2.attr
+
+The ``mypkg.path`` namespace and its two entries are
+loaded when they are accessed. This means:
+
+* lazy loading - only what is actually needed is ever loaded
+
+* only the root "mypkg" ever needs to be imported to get
+ access to the complete functionality.
+
+* the underlying modules are also accessible, for example::
+
+ from mypkg.sub import Class1
+
+
+Including apipkg in your package
+--------------------------------------
+
+If you don't want to add an ``apipkg`` dependency to your package you
+can copy the `apipkg.py`_ file somewhere to your own package,
+for example ``_mypkg/apipkg.py`` in the above example. You
+then import the ``initpkg`` function from that new place and
+are good to go.
+
+.. _`small pure python module`:
+.. _`apipkg.py`: http://bitbucket.org/hpk42/apipkg/src/tip/apipkg.py
+
+Feedback?
+-----------------------
+
+If you have questions you are welcome to
+
+* join the #pylib channel on irc.freenode.net
+* subscribe to the http://codespeak.net/mailman/listinfo/py-dev list.
+* create an issue on http://bitbucket.org/hpk42/apipkg/issues
+
+have fun,
+holger krekel
+
+
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/RECORD b/py/_vendored_packages/apipkg-1.4.dist-info/RECORD
new file mode 100644
index 0000000..dc72959
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/RECORD
@@ -0,0 +1,9 @@
+apipkg.py,sha256=BNnv_qvq8zZvku-uudoqgp3XTNFbwsNUmtzOKrVI7X0,6420
+apipkg-1.4.dist-info/top_level.txt,sha256=3TGS6nmN7kjxhUK4LpPCB3QkQI34QYGrT0ZQGWajoZ8,7
+apipkg-1.4.dist-info/METADATA,sha256=Fk_8BrHyXE--kvB3_ZBKgwvPaKusAZUjchH-kpB63Hs,3491
+apipkg-1.4.dist-info/DESCRIPTION.rst,sha256=RkMQqk5ljhGy0DiZkR_nbpjqvwCIhuIEHsyvkn3O96k,2803
+apipkg-1.4.dist-info/metadata.json,sha256=GdshYrA_7gAII3E3EQMH-31BHzU-klTZ6bPQzlDmuy4,779
+apipkg-1.4.dist-info/WHEEL,sha256=AvR0WeTpDaxT645bl5FQxUK6NPsTls2ttpcGJg3j1Xg,110
+apipkg-1.4.dist-info/RECORD,,
+apipkg-1.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
+__pycache__/apipkg.cpython-35.pyc,,
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/WHEEL b/py/_vendored_packages/apipkg-1.4.dist-info/WHEEL
new file mode 100644
index 0000000..9dff69d
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/WHEEL
@@ -0,0 +1,6 @@
+Wheel-Version: 1.0
+Generator: bdist_wheel (0.24.0)
+Root-Is-Purelib: true
+Tag: py2-none-any
+Tag: py3-none-any
+
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/metadata.json b/py/_vendored_packages/apipkg-1.4.dist-info/metadata.json
new file mode 100644
index 0000000..05609b9
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/metadata.json
@@ -0,0 +1 @@
+{"license": "MIT License", "name": "apipkg", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "summary": "apipkg: namespace control and lazy-import mechanism", "platform": "unix", "version": "1.4", "extensions": {"python.details": {"project_urls": {"Home": "http://bitbucket.org/hpk42/apipkg"}, "document_names": {"description": "DESCRIPTION.rst"}, "contacts": [{"role": "author", "email": "holger at merlinux.eu", "name": "holger krekel"}]}}, "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Topic :: Software Development :: Libraries", "Programming Language :: Python"]} \ No newline at end of file
diff --git a/py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt b/py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt
new file mode 100644
index 0000000..e2221c8
--- /dev/null
+++ b/py/_vendored_packages/apipkg-1.4.dist-info/top_level.txt
@@ -0,0 +1 @@
+apipkg
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/DESCRIPTION.rst b/py/_vendored_packages/iniconfig-1.0.0.dist-info/DESCRIPTION.rst
new file mode 100644
index 0000000..6d59bc2
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/DESCRIPTION.rst
@@ -0,0 +1,53 @@
+iniconfig: brain-dead simple parsing of ini files
+=======================================================
+
+iniconfig is a small and simple INI-file parser module
+having a unique set of features:
+
+* tested against Python2.4 across to Python3.2, Jython, PyPy
+* maintains order of sections and entries
+* supports multi-line values with or without line-continuations
+* supports "#" comments everywhere
+* raises errors with proper line-numbers
+* no bells and whistles like automatic substitutions
+* iniconfig raises an Error if two sections have the same name.
+
+If you encounter issues or have feature wishes please report them to:
+
+ http://github.org/RonnyPfannschmidt/iniconfig/issues
+
+Basic Example
+===================================
+
+If you have an ini file like this::
+
+ # content of example.ini
+ [section1] # comment
+ name1=value1 # comment
+ name1b=value1,value2 # comment
+
+ [section2]
+ name2=
+ line1
+ line2
+
+then you can do::
+
+ >>> import iniconfig
+ >>> ini = iniconfig.IniConfig("example.ini")
+ >>> ini['section1']['name1'] # raises KeyError if not exists
+ 'value1'
+ >>> ini.get('section1', 'name1b', [], lambda x: x.split(","))
+ ['value1', 'value2']
+ >>> ini.get('section1', 'notexist', [], lambda x: x.split(","))
+ []
+ >>> [x.name for x in list(ini)]
+ ['section1', 'section2']
+ >>> list(list(ini)[0].items())
+ [('name1', 'value1'), ('name1b', 'value1,value2')]
+ >>> 'section1' in ini
+ True
+ >>> 'inexistendsection' in ini
+ False
+
+
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/INSTALLER b/py/_vendored_packages/iniconfig-1.0.0.dist-info/INSTALLER
new file mode 100644
index 0000000..a1b589e
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/INSTALLER
@@ -0,0 +1 @@
+pip
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/METADATA b/py/_vendored_packages/iniconfig-1.0.0.dist-info/METADATA
new file mode 100644
index 0000000..79ea62d
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/METADATA
@@ -0,0 +1,78 @@
+Metadata-Version: 2.0
+Name: iniconfig
+Version: 1.0.0
+Summary: iniconfig: brain-dead simple config-ini parsing
+Home-page: http://github.com/RonnyPfannschmidt/iniconfig
+Author: Ronny Pfannschmidt, Holger Krekel
+Author-email: opensource@ronnypfannschmidt.de, holger.krekel@gmail.com
+License: MIT License
+Platform: unix
+Platform: linux
+Platform: osx
+Platform: cygwin
+Platform: win32
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Topic :: Software Development :: Libraries
+Classifier: Topic :: Utilities
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2
+Classifier: Programming Language :: Python :: 3
+
+iniconfig: brain-dead simple parsing of ini files
+=======================================================
+
+iniconfig is a small and simple INI-file parser module
+having a unique set of features:
+
+* tested against Python2.4 across to Python3.2, Jython, PyPy
+* maintains order of sections and entries
+* supports multi-line values with or without line-continuations
+* supports "#" comments everywhere
+* raises errors with proper line-numbers
+* no bells and whistles like automatic substitutions
+* iniconfig raises an Error if two sections have the same name.
+
+If you encounter issues or have feature wishes please report them to:
+
+ http://github.org/RonnyPfannschmidt/iniconfig/issues
+
+Basic Example
+===================================
+
+If you have an ini file like this::
+
+ # content of example.ini
+ [section1] # comment
+ name1=value1 # comment
+ name1b=value1,value2 # comment
+
+ [section2]
+ name2=
+ line1
+ line2
+
+then you can do::
+
+ >>> import iniconfig
+ >>> ini = iniconfig.IniConfig("example.ini")
+ >>> ini['section1']['name1'] # raises KeyError if not exists
+ 'value1'
+ >>> ini.get('section1', 'name1b', [], lambda x: x.split(","))
+ ['value1', 'value2']
+ >>> ini.get('section1', 'notexist', [], lambda x: x.split(","))
+ []
+ >>> [x.name for x in list(ini)]
+ ['section1', 'section2']
+ >>> list(list(ini)[0].items())
+ [('name1', 'value1'), ('name1b', 'value1,value2')]
+ >>> 'section1' in ini
+ True
+ >>> 'inexistendsection' in ini
+ False
+
+
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/RECORD b/py/_vendored_packages/iniconfig-1.0.0.dist-info/RECORD
new file mode 100644
index 0000000..ec2f5e1
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/RECORD
@@ -0,0 +1,9 @@
+iniconfig.py,sha256=-pBe5AF_6aAwo1CxJQ8i_zJq6ejc6IxHta7qk2tNJhY,5208
+iniconfig-1.0.0.dist-info/DESCRIPTION.rst,sha256=BDLMwWqfjpwZ5yqXRvz1x6bf8Dnt_pZhElekAwtL19o,1522
+iniconfig-1.0.0.dist-info/METADATA,sha256=bb2T8WUSDXXiUVxZ4WXhbffq6stikMTlB1jyrPbLfyU,2405
+iniconfig-1.0.0.dist-info/RECORD,,
+iniconfig-1.0.0.dist-info/WHEEL,sha256=3XK1Z4AI42GuJXciCpiHMOkbehxRV8QDBW8IU41k3ZU,96
+iniconfig-1.0.0.dist-info/metadata.json,sha256=UYYwW0p815nU4qz8Iq1gGqIYaAcsCyGju3jXvTOyXSI,950
+iniconfig-1.0.0.dist-info/top_level.txt,sha256=7KfM0fugdlToj9UW7enKXk2HYALQD8qHiyKtjhSzgN8,10
+iniconfig-1.0.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
+__pycache__/iniconfig.cpython-35.pyc,,
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/WHEEL b/py/_vendored_packages/iniconfig-1.0.0.dist-info/WHEEL
new file mode 100644
index 0000000..15b96c9
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/WHEEL
@@ -0,0 +1,5 @@
+Wheel-Version: 1.0
+Generator: bdist_wheel (0.30.0.a0)
+Root-Is-Purelib: true
+Tag: cp35-none-any
+
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/metadata.json b/py/_vendored_packages/iniconfig-1.0.0.dist-info/metadata.json
new file mode 100644
index 0000000..084daa6
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/metadata.json
@@ -0,0 +1 @@
+{"classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Topic :: Software Development :: Libraries", "Topic :: Utilities", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3"], "extensions": {"python.details": {"contacts": [{"email": "opensource@ronnypfannschmidt.de, holger.krekel@gmail.com", "name": "Ronny Pfannschmidt, Holger Krekel", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://github.com/RonnyPfannschmidt/iniconfig"}}}, "generator": "bdist_wheel (0.30.0.a0)", "license": "MIT License", "metadata_version": "2.0", "name": "iniconfig", "platform": "unix", "summary": "iniconfig: brain-dead simple config-ini parsing", "version": "1.0.0"} \ No newline at end of file
diff --git a/py/_vendored_packages/iniconfig-1.0.0.dist-info/top_level.txt b/py/_vendored_packages/iniconfig-1.0.0.dist-info/top_level.txt
new file mode 100644
index 0000000..9dda536
--- /dev/null
+++ b/py/_vendored_packages/iniconfig-1.0.0.dist-info/top_level.txt
@@ -0,0 +1 @@
+iniconfig
diff --git a/tasks/__init__.py b/tasks/__init__.py
new file mode 100644
index 0000000..5d74b64
--- /dev/null
+++ b/tasks/__init__.py
@@ -0,0 +1,12 @@
+"""
+Invoke tasks to help with pytest development and release process.
+"""
+
+import invoke
+
+from . import vendoring
+
+
+ns = invoke.Collection(
+ vendoring
+)
diff --git a/tasks/vendoring.py b/tasks/vendoring.py
new file mode 100644
index 0000000..fbc171b
--- /dev/null
+++ b/tasks/vendoring.py
@@ -0,0 +1,23 @@
+from __future__ import absolute_import, print_function
+import py
+import invoke
+
+VENDOR_TARGET = py.path.local("py/_vendored_packages")
+GOOD_FILES = 'README.md', '__init__.py'
+
+@invoke.task()
+def remove_libs(ctx):
+ print("removing vendored libs")
+ for path in VENDOR_TARGET.listdir():
+ if path.basename not in GOOD_FILES:
+ print(" ", path)
+ path.remove()
+
+@invoke.task(pre=[remove_libs])
+def update_libs(ctx):
+ print("installing libs")
+ ctx.run("pip install -t {target} apipkg iniconfig".format(target=VENDOR_TARGET))
+ ctx.run("git add {target}".format(target=VENDOR_TARGET))
+ print("Please commit to finish the update after running the tests:")
+ print()
+ print(' git commit -am "Updated vendored libs"')
diff --git a/testing/root/test_error.py b/testing/root/test_error.py
index a1185f3..7bfbef3 100644
--- a/testing/root/test_error.py
+++ b/testing/root/test_error.py
@@ -2,6 +2,8 @@
import py
import errno
+import sys
+import subprocess
def test_error_classes():
@@ -33,7 +35,7 @@ def test_unknown_error():
assert cls is cls2
-def test_error_conversion_ENOTDIR(testdir):
+def test_error_conversion_enotdir(testdir):
p = testdir.makepyfile("")
excinfo = py.test.raises(py.error.Error, py.error.checked_call, p.listdir)
assert isinstance(excinfo.value, EnvironmentError)
@@ -46,6 +48,12 @@ def test_checked_call_supports_kwargs(tmpdir):
py.error.checked_call(tempfile.mkdtemp, dir=str(tmpdir))
+def test_error_importable():
+ """Regression test for #179"""
+ subprocess.check_call(
+ [sys.executable, '-c', 'from py.error import ENOENT'])
+
+
try:
import unittest
unittest.TestCase.assertWarns
@@ -56,13 +64,13 @@ else:
import warnings
class Case(unittest.TestCase):
- def test_assertWarns(self):
+ def test_assert_warns(self):
# Clear everything "py.*" from sys.modules and re-import py
# as a fresh start
for mod in tuple(sys.modules.keys()):
if mod and (mod == 'py' or mod.startswith('py.')):
del sys.modules[mod]
- import py
+ __import__('py')
with self.assertWarns(UserWarning):
warnings.warn('this should work')
diff --git a/tox.ini b/tox.ini
index 601661c..d5f362a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,13 +4,13 @@ envlist=py{27,34,35,36}-pytest{29,30,31}
[testenv]
changedir=testing
commands=
- pip install -U .. # hande the install order fallout since pytest depends on pip
-
- py.test --confcutdir=.. -rfsxX --junitxml={envlogdir}/junit-{envname}.xml []
+ pip install -U .. # hande the install order fallout since pytest depends on pip
+ py.test --confcutdir=.. -rfsxX --junitxml={envlogdir}/junit-{envname}.xml []
deps=
- pytest29: pytest~=2.9.0
- pytest30: pytest~=3.0.0
- pytest31: pytest~=3.1.0
+ attrs
+ pytest29: pytest~=2.9.0
+ pytest30: pytest~=3.0.0
+ pytest31: pytest~=3.1.0
[testenv:py27-xdist]
basepython=python2.7