Skip to content

Updated vendored libs #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 0 additions & 87 deletions py/_vendored_packages/apipkg-1.4.dist-info/DESCRIPTION.rst

This file was deleted.

9 changes: 0 additions & 9 deletions py/_vendored_packages/apipkg-1.4.dist-info/RECORD

This file was deleted.

1 change: 0 additions & 1 deletion py/_vendored_packages/apipkg-1.4.dist-info/metadata.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Metadata-Version: 2.0
Metadata-Version: 2.1
Name: apipkg
Version: 1.4
Version: 1.5
Summary: apipkg: namespace control and lazy-import mechanism
Home-page: http://bitbucket.org/hpk42/apipkg
Home-page: https://github.com/pytest-dev/apipkg
Author: holger krekel
Author-email: holger at merlinux.eu
Maintainer: Ronny Pfannschmidt
Maintainer-email: [email protected]
License: MIT License
Platform: unix
Platform: linux
Expand All @@ -19,19 +20,25 @@ Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*

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.
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 CPython 2.7 and 3.4+,
Jython and PyPy. It cooperates 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.
can copy paste the ~200 lines of code into your project.


Tutorial example
Expand All @@ -54,7 +61,7 @@ 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.
regular Python package.

Namespace dictionaries contain ``name: value`` mappings
where the value may be another namespace dictionary or
Expand All @@ -75,7 +82,7 @@ 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.
access to the complete functionality

* the underlying modules are also accessible, for example::

Expand All @@ -91,17 +98,16 @@ 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
.. _`small pure Python module`:
.. _`apipkg.py`: https://github.com/pytest-dev/apipkg/blob/master/src/apipkg/__init__.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
* create an issue on https://github.com/pytest-dev/apipkg/issues

have fun,
holger krekel
Expand Down
10 changes: 10 additions & 0 deletions py/_vendored_packages/apipkg-1.5.dist-info/RECORD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apipkg-1.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
apipkg-1.5.dist-info/METADATA,sha256=tIG1DSBzSeqmSRpOKHSEBmT1eOPdK8xK01xAIADuks4,3800
apipkg-1.5.dist-info/RECORD,,
apipkg-1.5.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
apipkg-1.5.dist-info/WHEEL,sha256=gduuPyBvFJQSQ0zdyxF7k0zynDXbIbvg5ZBHoXum5uk,110
apipkg-1.5.dist-info/top_level.txt,sha256=3TGS6nmN7kjxhUK4LpPCB3QkQI34QYGrT0ZQGWajoZ8,7
apipkg/__init__.py,sha256=VogR4mDwYmeOdJnjGi-RoMB1qJnD6_puDYj_nRolzhM,6707
apipkg/__pycache__/__init__.cpython-38.pyc,,
apipkg/__pycache__/version.cpython-38.pyc,,
apipkg/version.py,sha256=YN6DnKyEPqjDAauJuwJRG9vlKbWVLd9gAbH7mkQXXNo,114
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Wheel-Version: 1.0
Generator: bdist_wheel (0.24.0)
Generator: bdist_wheel (0.31.1)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
"""
apipkg: control the exported namespace of a python package.
apipkg: control the exported namespace of a Python package.

see http://pypi.python.org/pypi/apipkg
see https://pypi.python.org/pypi/apipkg

(c) holger krekel, 2009 - MIT license
"""
import os
import sys
from types import ModuleType


__version__ = '1.4'
from .version import version as __version__


def _py_abspath(path):
Expand All @@ -37,8 +36,9 @@ def distribution_version(name):
return dist.version


def initpkg(pkgname, exportdefs, attr=dict(), eager=False):
def initpkg(pkgname, exportdefs, attr=None, eager=False):
""" initialize given package from the export definitions. """
attr = attr or {}
oldmod = sys.modules.get(pkgname)
d = {}
f = getattr(oldmod, '__file__', None)
Expand All @@ -51,6 +51,8 @@ def initpkg(pkgname, exportdefs, attr=dict(), eager=False):
d['__loader__'] = oldmod.__loader__
if hasattr(oldmod, '__path__'):
d['__path__'] = [_py_abspath(p) for p in oldmod.__path__]
if hasattr(oldmod, '__package__'):
d['__package__'] = oldmod.__package__
if '__doc__' not in exportdefs and getattr(oldmod, '__doc__', None):
d['__doc__'] = oldmod.__doc__
d.update(attr)
Expand All @@ -60,12 +62,13 @@ def initpkg(pkgname, exportdefs, attr=dict(), eager=False):
sys.modules[pkgname] = mod
# eagerload in bypthon to avoid their monkeypatching breaking packages
if 'bpython' in sys.modules or eager:
for module in sys.modules.values():
for module in list(sys.modules.values()):
if isinstance(module, ApiModule):
module.__dict__


def importobj(modpath, attrname):
"""imports a module, then resolves the attrname on it"""
module = __import__(modpath, None, None, ['__doc__'])
if not attrname:
return module
Expand All @@ -78,6 +81,7 @@ def importobj(modpath, attrname):


class ApiModule(ModuleType):
"""the magical lazy-loading module standing"""
def __docget(self):
try:
return self.__doc
Expand Down Expand Up @@ -121,13 +125,13 @@ def __init__(self, name, importspec, implprefix=None, attr=None):
self.__map__[name] = (modpath, attrname)

def __repr__(self):
l = []
repr_list = []
if hasattr(self, '__version__'):
l.append("version=" + repr(self.__version__))
repr_list.append("version=" + repr(self.__version__))
if hasattr(self, '__file__'):
l.append('from ' + repr(self.__file__))
if l:
return '<ApiModule %r %s>' % (self.__name__, " ".join(l))
repr_list.append('from ' + repr(self.__file__))
if repr_list:
return '<ApiModule %r %s>' % (self.__name__, " ".join(repr_list))
return '<ApiModule %r>' % (self.__name__,)

def __makeattr(self, name):
Expand Down
4 changes: 4 additions & 0 deletions py/_vendored_packages/apipkg/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = '1.5'
53 changes: 0 additions & 53 deletions py/_vendored_packages/iniconfig-1.0.0.dist-info/DESCRIPTION.rst

This file was deleted.

9 changes: 0 additions & 9 deletions py/_vendored_packages/iniconfig-1.0.0.dist-info/RECORD

This file was deleted.

5 changes: 0 additions & 5 deletions py/_vendored_packages/iniconfig-1.0.0.dist-info/WHEEL

This file was deleted.

This file was deleted.

19 changes: 19 additions & 0 deletions py/_vendored_packages/iniconfig-1.0.1.dist-info/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Loading