Skip to content

Commit 2e7047f

Browse files
Squashed 'tools/third_party/funcsigs/' content from commit db7f0af
git-subtree-dir: tools/third_party/funcsigs git-subtree-split: db7f0af
0 parents  commit 2e7047f

22 files changed

Lines changed: 3194 additions & 0 deletions

.coveragerc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[run]
2+
source=funcsigs
3+
omit=funcsigs/odict*
4+
5+
[report]
6+
include=funcsigs*

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: python
2+
python:
3+
- 2.6
4+
- 2.7
5+
- 3.2
6+
- 3.3
7+
- pypy
8+
install:
9+
- pip install -r requirements/development.txt -r requirements/production.txt
10+
- python setup.py install
11+
script:
12+
- coverage run setup.py test
13+
- coverage report --show-missing
14+
after_success:
15+
- coveralls
16+
notifications:
17+
email: aaron.iles+travis-ci@gmail.com

CHANGELOG

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Changelog
2+
---------
3+
4+
0.4 (2013-12-20)
5+
````````````````
6+
* Fix unbound methods getting their first parameter curried
7+
* Publish Python wheel packages
8+
9+
0.3 (2013-05-29)
10+
````````````````
11+
* Fix annotation formatting of builtin types on Python 2.x
12+
13+
0.2 (2012-01-07)
14+
````````````````
15+
* PyPy compatability
16+
17+
0.1 (2012-01-06)
18+
````````````````
19+
* Initial release

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2013 Aaron Iles
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

MANIFEST.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
recursive-include docs *
2+
recursive-include tests *.py
3+
include *.py
4+
include CHANGELOG
5+
include LICENSE
6+
include MANIFEST.in
7+
include README.rst

Makefile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
SHELL := /bin/bash
2+
3+
deps:
4+
pip install --upgrade \
5+
-r requirements/development.txt \
6+
-r requirements/production.txt
7+
8+
sdist:
9+
python setup.py sdist
10+
python setup.py bdist_wheel
11+
12+
register:
13+
python setup.py register
14+
python setup.py sdist upload
15+
python setup.py bdist_wheel upload
16+
17+
site:
18+
cd docs; make html
19+
20+
test:
21+
coverage run setup.py test
22+
23+
unittest:
24+
coverage run -m unittest discover
25+
26+
lint:
27+
flake8 --exit-zero funcsigs tests
28+
29+
coverage:
30+
coverage report --show-missing
31+
32+
clean:
33+
python setup.py clean --all
34+
find . -type f -name "*.pyc" -exec rm '{}' +
35+
find . -type d -name "__pycache__" -exec rmdir '{}' +
36+
rm -rf *.egg-info .coverage
37+
cd docs; make clean
38+
39+
docs: site

README.rst

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
funcsigs
2+
========
3+
4+
``funcsigs`` is a backport of the `PEP 362`_ function signature features from
5+
Python 3.3's `inspect`_ module. The backport is compatible with Python 2.6, 2.7
6+
as well as 3.2 and up.
7+
8+
|pypi_version|
9+
10+
Documentation
11+
-------------
12+
13+
The reference documentation is standard library documentation for the
14+
`inspect`_ module in Python3. This documentation has been included in the
15+
``funcsigs`` package documentation hosted on `Read The Docs`_.
16+
17+
Example
18+
-------
19+
20+
To obtain a signature object, pass the target function to the
21+
``funcsigs.signature`` function. ::
22+
23+
>>> from funcsigs import signature
24+
>>> def foo(a, b=None, *args, **kwargs):
25+
... pass
26+
27+
>>> sig = signature(foo)
28+
29+
For the details of the signature object, refer to the either the package of
30+
standard library documentation.
31+
32+
Compatability
33+
-------------
34+
35+
The ``funcsigs`` backport has been tested against:
36+
37+
* CPython 2.6
38+
* CPython 2.7
39+
* CPython 3.2
40+
* PyPy 1.9
41+
42+
Continuous integration testing is provided by `Travis CI`_.
43+
44+
Under Python 2.x there is a compatability issue when a function is assigned to
45+
the ``__wrapped__`` property of a class after it has been constructed.
46+
Similiarily there under PyPy directly passing the ``__call__`` method of a
47+
builtin is also a compatability issues. Otherwise the functionality is
48+
believed to be uniform between both Python2 and Python3.
49+
50+
Issues
51+
------
52+
53+
Source code for ``funcsigs`` is hosted on `GitHub`_. Any bug reports or feature
54+
requests can be made using GitHub's `issues system`_. |build_status| |coverage|
55+
56+
Copyright
57+
---------
58+
59+
This is a derived work of CPython under the terms of the `PSF License
60+
Agreement`_. The original CPython inspect module, its unit tests and
61+
documentation are the copyright of the Python Software Foundation. The derived
62+
work is distributed under the `Apache License Version 2.0`_.
63+
64+
.. _Apache License Version 2.0: http://opensource.org/licenses/Apache-2.0
65+
.. _GitHub: https://github.com/aliles/funcsigs
66+
.. _PSF License Agreement: http://docs.python.org/3/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
67+
.. _Travis CI: http://travis-ci.org/
68+
.. _Read The Docs: http://funcsigs.readthedocs.org/
69+
.. _PEP 362: http://www.python.org/dev/peps/pep-0362/
70+
.. _inspect: http://docs.python.org/3/library/inspect.html#introspecting-callables-with-the-signature-object
71+
.. _issues system: https://github.com/alies/funcsigs/issues
72+
73+
.. |build_status| image:: https://secure.travis-ci.org/aliles/funcsigs.png?branch=master
74+
:target: http://travis-ci.org/#!/aliles/funcsigs
75+
:alt: Current build status
76+
77+
.. |coverage| image:: https://coveralls.io/repos/aliles/funcsigs/badge.png?branch=master
78+
:target: https://coveralls.io/r/aliles/funcsigs?branch=master
79+
:alt: Coverage status
80+
81+
.. |pypi_version| image:: https://pypip.in/v/funcsigs/badge.png
82+
:target: https://crate.io/packages/funcsigs/
83+
:alt: Latest PyPI version

docs/Makefile

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = _build
9+
10+
# Internal variables.
11+
PAPEROPT_a4 = -D latex_paper_size=a4
12+
PAPEROPT_letter = -D latex_paper_size=letter
13+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
14+
# the i18n builder cannot share the environment and doctrees with the others
15+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
16+
17+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
18+
19+
help:
20+
@echo "Please use \`make <target>' where <target> is one of"
21+
@echo " html to make standalone HTML files"
22+
@echo " dirhtml to make HTML files named index.html in directories"
23+
@echo " singlehtml to make a single large HTML file"
24+
@echo " pickle to make pickle files"
25+
@echo " json to make JSON files"
26+
@echo " htmlhelp to make HTML files and a HTML help project"
27+
@echo " qthelp to make HTML files and a qthelp project"
28+
@echo " devhelp to make HTML files and a Devhelp project"
29+
@echo " epub to make an epub"
30+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
31+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
32+
@echo " text to make text files"
33+
@echo " man to make manual pages"
34+
@echo " texinfo to make Texinfo files"
35+
@echo " info to make Texinfo files and run them through makeinfo"
36+
@echo " gettext to make PO message catalogs"
37+
@echo " changes to make an overview of all changed/added/deprecated items"
38+
@echo " linkcheck to check all external links for integrity"
39+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
40+
41+
clean:
42+
-rm -rf $(BUILDDIR)
43+
44+
html:
45+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
46+
@echo
47+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
48+
49+
dirhtml:
50+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
51+
@echo
52+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
53+
54+
singlehtml:
55+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
56+
@echo
57+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
58+
59+
pickle:
60+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
61+
@echo
62+
@echo "Build finished; now you can process the pickle files."
63+
64+
json:
65+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
66+
@echo
67+
@echo "Build finished; now you can process the JSON files."
68+
69+
htmlhelp:
70+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
71+
@echo
72+
@echo "Build finished; now you can run HTML Help Workshop with the" \
73+
".hhp project file in $(BUILDDIR)/htmlhelp."
74+
75+
qthelp:
76+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
77+
@echo
78+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
79+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
80+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/funcsigs.qhcp"
81+
@echo "To view the help file:"
82+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/funcsigs.qhc"
83+
84+
devhelp:
85+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
86+
@echo
87+
@echo "Build finished."
88+
@echo "To view the help file:"
89+
@echo "# mkdir -p $$HOME/.local/share/devhelp/funcsigs"
90+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/funcsigs"
91+
@echo "# devhelp"
92+
93+
epub:
94+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
95+
@echo
96+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
97+
98+
latex:
99+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
100+
@echo
101+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
102+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
103+
"(use \`make latexpdf' here to do that automatically)."
104+
105+
latexpdf:
106+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
107+
@echo "Running LaTeX files through pdflatex..."
108+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
109+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
110+
111+
text:
112+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
113+
@echo
114+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
115+
116+
man:
117+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
118+
@echo
119+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
120+
121+
texinfo:
122+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
123+
@echo
124+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
125+
@echo "Run \`make' in that directory to run these through makeinfo" \
126+
"(use \`make info' here to do that automatically)."
127+
128+
info:
129+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
130+
@echo "Running Texinfo files through makeinfo..."
131+
make -C $(BUILDDIR)/texinfo info
132+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
133+
134+
gettext:
135+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
136+
@echo
137+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
138+
139+
changes:
140+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
141+
@echo
142+
@echo "The overview file is in $(BUILDDIR)/changes."
143+
144+
linkcheck:
145+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
146+
@echo
147+
@echo "Link check complete; look for any errors in the above output " \
148+
"or in $(BUILDDIR)/linkcheck/output.txt."
149+
150+
doctest:
151+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
152+
@echo "Testing of doctests in the sources finished, look at the " \
153+
"results in $(BUILDDIR)/doctest/output.txt."

docs/_templates/page.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "!page.html" %}
2+
{% block extrahead %}
3+
<a href="https://github.com/aliles/funcsigs">
4+
<img style="position: absolute; top: 0; right: 0; border: 0;"
5+
src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"
6+
alt="Fork me on GitHub">
7+
</a>
8+
{{ super() }}
9+
{% endblock %}

0 commit comments

Comments
 (0)