pax_global_header00006660000000000000000000000064132260354510014513gustar00rootroot0000000000000052 comment=52f802c77573c0e64240cd47246de01ffbf96c0c requirements-parser-0.2.0/000077500000000000000000000000001322603545100155275ustar00rootroot00000000000000requirements-parser-0.2.0/.coveragerc000066400000000000000000000000471322603545100176510ustar00rootroot00000000000000[run] source = requirements branch = 1 requirements-parser-0.2.0/.gitignore000066400000000000000000000001071322603545100175150ustar00rootroot00000000000000*.pyc docs/_build/* *.db *.egg-info *.egg dist/ build/ .coverage venv* requirements-parser-0.2.0/.travis.yml000066400000000000000000000003401322603545100176350ustar00rootroot00000000000000language: python python: - "3.6" - "3.5" - "3.4" - "3.3" - "2.7" install: - pip install 'flake8' 'coverage<4' coveralls script: - coverage run setup.py test - flake8 requirements after_success: coveralls requirements-parser-0.2.0/AUTHORS.rst000066400000000000000000000003731322603545100174110ustar00rootroot00000000000000AUTHORS ======= - David Fischer (@davidfischer) - Trey Hunner (@treyhunner) - Dima Veselov (@dveselov) - Sascha Peilicke (@saschpe) - Jayson Reis (@jaysonsantos) - Max Shenfield (@mshenfield) - Nicolas Delaby (@ticosax) - Stéphane Bidoul (@sbidoul) requirements-parser-0.2.0/LICENSE.rst000066400000000000000000000024631322603545100173500ustar00rootroot00000000000000License ======= Requirements Parser is licensed under the BSD license. Copyright (c) 2012 - 2013, David Fischer All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY David Fischer ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL David Fischer BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. requirements-parser-0.2.0/MANIFEST.in000066400000000000000000000000161322603545100172620ustar00rootroot00000000000000include *.rst requirements-parser-0.2.0/README.rst000066400000000000000000000033621322603545100172220ustar00rootroot00000000000000Requirements Parser =================== .. image:: https://travis-ci.org/davidfischer/requirements-parser.svg?branch=master :target: https://travis-ci.org/davidfischer/requirements-parser .. image:: https://coveralls.io/repos/github/davidfischer/requirements-parser/badge.svg?branch=master :target: https://coveralls.io/github/davidfischer/requirements-parser?branch=master .. image:: http://readthedocs.org/projects/requirements-parser/badge/?version=latest :target: http://requirements-parser.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status This is a small Python module for parsing Pip_ requirement files. The goal is to parse everything in the `Pip requirement file format`_ spec. .. _Pip: http://www.pip-installer.org/ .. _Pip requirement file format: https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format Installation ============ :: pip install requirements-parser Examples ======== Requirements parser can parse a file-like object or a text string. .. code-block:: python >>> import requirements >>> with open('requirements.txt', 'r') as fd: ... for req in requirements.parse(fd): ... print(req.name, req.specs) Django [('>=', '1.11'), ('<', '1.12')] six [('==', '1.10.0')] It can handle most if not all of the options in requirement files that do not involve traversing the local filesystem. These include: * editables (`-e git+https://github.com/toastdriven/pyelasticsearch.git`) * version control URIs * egg hashes and subdirectories (`#egg=django-haystack&subdirectory=setup`) * extras (`DocParser[PDF]`) * URLs Documentation ============= For more details and examples, the documentation is available at: http://requirements-parser.readthedocs.io. requirements-parser-0.2.0/docs/000077500000000000000000000000001322603545100164575ustar00rootroot00000000000000requirements-parser-0.2.0/docs/Makefile000066400000000000000000000152321322603545100201220ustar00rootroot00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/RequirementsParser.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/RequirementsParser.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/RequirementsParser" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/RequirementsParser" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." requirements-parser-0.2.0/docs/changelog.rst000066400000000000000000000027461322603545100211510ustar00rootroot00000000000000Changelog ========= **Version 0.2.0** (11 Jan 2018) This release dropped support for Python 3.2. * Support multiple hashing algorithms at the end of the URL (`#24`_) * Preserve login info in requirement URI (`#33`_) * Support subdirectory fragments (`#32`_) * Support version control URLs with extras (`#30`_) .. _#24: https://github.com/davidfischer/requirements-parser/pull/24 .. _#33: https://github.com/davidfischer/requirements-parser/pull/33 .. _#32: https://github.com/davidfischer/requirements-parser/pull/32 .. _#30: https://github.com/davidfischer/requirements-parser/pull/30 **Version 0.1.0** (2 May 2015) * Fix a bug involving parsing projects with underscores (`#17`_) * Parse recursive requirements (`#19`_) .. _#17: https://github.com/davidfischer/requirements-parser/pull/17 .. _#19: https://github.com/davidfischer/requirements-parser/pull/19 **Version 0.0.6** (16 August 2013) * Fixed a packaging error in v0.0.5 **Version 0.0.5** (16 August 2013) * **Backwards incompatible change** to refactor the parser. * Parser now handles VCS specific revisions and parses out data such as whether the requirement is a local file or "editable". * Improved handling of "editable" requirements * Improved handling of non-VCS URI requirements * Fixes: `#8`_, `#10`_ and `#12`_ .. _#8: https://github.com/davidfischer/requirements-parser/issues/8 .. _#10: https://github.com/davidfischer/requirements-parser/issues/10 .. _#12: https://github.com/davidfischer/requirements-parser/issues/12 requirements-parser-0.2.0/docs/conf.py000066400000000000000000000177171322603545100177730ustar00rootroot00000000000000#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Requirements Parser documentation build configuration file, created by # sphinx-quickstart on Fri Aug 16 07:44:12 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) import requirements # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'Requirements Parser' copyright = '2015, David Fischer' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = requirements.version() # The full version, including alpha/beta/rc tags. release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'RequirementsParserdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'RequirementsParser.tex', 'Requirements Parser Documentation', 'David Fischer', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'requirementsparser', 'Requirements Parser Documentation', ['David Fischer'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'RequirementsParser', 'Requirements Parser Documentation', 'David Fischer', 'RequirementsParser', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False requirements-parser-0.2.0/docs/index.rst000066400000000000000000000014321322603545100203200ustar00rootroot00000000000000Welcome to Requirements Parser's documentation! =============================================== Requirements parser is a Python module for parsing Pip_ requirement files. .. _Pip: http://www.pip-installer.org Requirements parser is BSD_ licensed. .. _BSD: http://opensource.org/licenses/BSD-2-Clause Quickstart: :: >>> import requirements >>> reqfile = """ Django>=1.5,<1.6 DocParser[PDF]==1.0.0 """ >>> for req in requirements.parse(reqfile): ... print(req.name, req.specs, req.extras) ... Django [('>=', '1.5'), ('<', '1.6')] [] DocParser [('==', '1.0.0')] ['pdf'] Contents: .. toctree:: :maxdepth: 2 usage changelog lowlevel Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` requirements-parser-0.2.0/docs/lowlevel.rst000066400000000000000000000010131322603545100210350ustar00rootroot00000000000000Low level API ============= Higher level parsing -------------------- Typically this is called via: :: >>> import requirements >>> requirements.parse('django>=1.5') .. automodule:: requirements.parser :members: Lower level parsing ------------------- Under the hood, the :class:`Requirement ` class does most of the heavy lifting. .. automodule:: requirements.requirement :members: Misc functions -------------- .. automodule:: requirements :members: requirements-parser-0.2.0/docs/usage.rst000066400000000000000000000024501322603545100203160ustar00rootroot00000000000000Usage ===== Requirements parser works very similarly to the way pip actually parses requirement files except that pip typically proceeds to install the relevant packages. Requirements come in a variety of forms such as requirement specifiers (such as requirements>=0.0.5), version control URIs, other URIs and local file paths. Parsing requirement specifiers ------------------------------ :: import requirements req = "django>=1.5,<1.6" parsed = list(requirements.parse(req))[0] parsed.name # django parsed.specs # [('>=', '1.5'), ('<', '1.6')] parsed.specifier # True Parsing version control requirements ------------------------------------ :: req = "-e git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack" parsed = list(requirements.parse(req))[0] parsed.name # django_haystack parsed.vcs # git parsed.revision # 259274e4127f723d76b893c87a82777f9490b960 parsed.uri # git+git://github.com/toastdriven/django-haystack parsed.editable # True (because of the -e option) Parsing local files ------------------- :: req = "-e path/to/project" parsed = list(requirements.parse(req))[0] parsed.local_file # True parsed.path # path/to/project requirements-parser-0.2.0/requirements/000077500000000000000000000000001322603545100202525ustar00rootroot00000000000000requirements-parser-0.2.0/requirements/__init__.py000066400000000000000000000005411322603545100223630ustar00rootroot00000000000000from .parser import parse # noqa _MAJOR = 0 _MINOR = 2 _PATCH = 0 def version_tuple(): ''' Returns a 3-tuple of ints that represent the version ''' return (_MAJOR, _MINOR, _PATCH) def version(): ''' Returns a string representation of the version ''' return '%d.%d.%d' % (version_tuple()) __version__ = version() requirements-parser-0.2.0/requirements/fragment.py000066400000000000000000000024221322603545100224270ustar00rootroot00000000000000import re # Copied from pip # https://github.com/pypa/pip/blob/281eb61b09d87765d7c2b92f6982b3fe76ccb0af/pip/index.py#L947 HASH_ALGORITHMS = set(['sha1', 'sha224', 'sha384', 'sha256', 'sha512', 'md5']) extras_require_search = re.compile( r'(?P.+)\[(?P[^\]]+)\]').search def parse_fragment(fragment_string): """Takes a fragment string nd returns a dict of the components""" fragment_string = fragment_string.lstrip('#') try: return dict( key_value_string.split('=') for key_value_string in fragment_string.split('&') ) except ValueError: raise ValueError( 'Invalid fragment string {fragment_string}'.format( fragment_string=fragment_string ) ) def get_hash_info(d): """Returns the first matching hashlib name and value from a dict""" for key in d.keys(): if key.lower() in HASH_ALGORITHMS: return key, d[key] return None, None def parse_extras_require(egg): if egg is not None: match = extras_require_search(egg) if match is not None: name = match.group('name') extras = match.group('extras') return name, [extra.strip() for extra in extras.split(',')] return egg, [] requirements-parser-0.2.0/requirements/parser.py000066400000000000000000000033751322603545100221300ustar00rootroot00000000000000import os import warnings from .requirement import Requirement def parse(reqstr): """ Parse a requirements file into a list of Requirements See: pip/req.py:parse_requirements() :param reqstr: a string or file like object containing requirements :returns: a *generator* of Requirement objects """ filename = getattr(reqstr, 'name', None) try: # Python 2.x compatibility if not isinstance(reqstr, basestring): reqstr = reqstr.read() except NameError: # Python 3.x only if not isinstance(reqstr, str): reqstr = reqstr.read() for line in reqstr.splitlines(): line = line.strip() if line == '': continue elif not line or line.startswith('#'): # comments are lines that start with # only continue elif line.startswith('-r') or line.startswith('--requirement'): _, new_filename = line.split() new_file_path = os.path.join(os.path.dirname(filename or '.'), new_filename) with open(new_file_path) as f: for requirement in parse(f): yield requirement elif line.startswith('-f') or line.startswith('--find-links') or \ line.startswith('-i') or line.startswith('--index-url') or \ line.startswith('--extra-index-url') or \ line.startswith('--no-index'): warnings.warn('Private repos not supported. Skipping.') continue elif line.startswith('-Z') or line.startswith('--always-unzip'): warnings.warn('Unused option --always-unzip. Skipping.') continue else: yield Requirement.parse(line) requirements-parser-0.2.0/requirements/requirement.py000066400000000000000000000175301322603545100231720ustar00rootroot00000000000000from __future__ import unicode_literals import re from pkg_resources import Requirement as Req from .fragment import get_hash_info, parse_fragment, parse_extras_require from .vcs import VCS, VCS_SCHEMES URI_REGEX = re.compile( r'^(?Phttps?|file|ftps?)://(?P[^#]+)' r'(#(?P\S+))?' ) VCS_REGEX = re.compile( r'^(?P{0})://'.format(r'|'.join( [scheme.replace('+', r'\+') for scheme in VCS_SCHEMES])) + r'((?P[^/@]+)@)?' r'(?P[^#@]+)' r'(@(?P[^#]+))?' r'(#(?P\S+))?' ) # This matches just about everyting LOCAL_REGEX = re.compile( r'^((?Pfile)://)?' r'(?P[^#]+)' + r'(#(?P\S+))?' ) class Requirement(object): """ Represents a single requirement Typically instances of this class are created with ``Requirement.parse``. For local file requirements, there's no verification that the file exists. This class attempts to be *dict-like*. See: http://www.pip-installer.org/en/latest/logic.html **Members**: * ``line`` - the actual requirement line being parsed * ``editable`` - a boolean whether this requirement is "editable" * ``local_file`` - a boolean whether this requirement is a local file/path * ``specifier`` - a boolean whether this requirement used a requirement specifier (eg. "django>=1.5" or "requirements") * ``vcs`` - a string specifying the version control system * ``revision`` - a version control system specifier * ``name`` - the name of the requirement * ``uri`` - the URI if this requirement was specified by URI * ``subdirectory`` - the subdirectory fragment of the URI * ``path`` - the local path to the requirement * ``hash_name`` - the type of hashing algorithm indicated in the line * ``hash`` - the hash value indicated by the requirement line * ``extras`` - a list of extras for this requirement (eg. "mymodule[extra1, extra2]") * ``specs`` - a list of specs for this requirement (eg. "mymodule>1.5,<1.6" => [('>', '1.5'), ('<', '1.6')]) """ def __init__(self, line): # Do not call this private method self.line = line self.editable = False self.local_file = False self.specifier = False self.vcs = None self.name = None self.subdirectory = None self.uri = None self.path = None self.revision = None self.hash_name = None self.hash = None self.extras = [] self.specs = [] def __repr__(self): return ''.format(self.line) def __getitem__(self, key): return getattr(self, key) def keys(self): return self.__dict__.keys() @classmethod def parse_editable(cls, line): """ Parses a Requirement from an "editable" requirement which is either a local project path or a VCS project URI. See: pip/req.py:from_editable() :param line: an "editable" requirement :returns: a Requirement instance for the given line :raises: ValueError on an invalid requirement """ req = cls('-e {0}'.format(line)) req.editable = True vcs_match = VCS_REGEX.match(line) local_match = LOCAL_REGEX.match(line) if vcs_match is not None: groups = vcs_match.groupdict() if groups.get('login'): req.uri = '{scheme}://{login}@{path}'.format(**groups) else: req.uri = '{scheme}://{path}'.format(**groups) req.revision = groups['revision'] if groups['fragment']: fragment = parse_fragment(groups['fragment']) egg = fragment.get('egg') req.name, req.extras = parse_extras_require(egg) req.hash_name, req.hash = get_hash_info(fragment) req.subdirectory = fragment.get('subdirectory') for vcs in VCS: if req.uri.startswith(vcs): req.vcs = vcs else: assert local_match is not None, 'This should match everything' groups = local_match.groupdict() req.local_file = True if groups['fragment']: fragment = parse_fragment(groups['fragment']) egg = fragment.get('egg') req.name, req.extras = parse_extras_require(egg) req.hash_name, req.hash = get_hash_info(fragment) req.subdirectory = fragment.get('subdirectory') req.path = groups['path'] return req @classmethod def parse_line(cls, line): """ Parses a Requirement from a non-editable requirement. See: pip/req.py:from_line() :param line: a "non-editable" requirement :returns: a Requirement instance for the given line :raises: ValueError on an invalid requirement """ req = cls(line) vcs_match = VCS_REGEX.match(line) uri_match = URI_REGEX.match(line) local_match = LOCAL_REGEX.match(line) if vcs_match is not None: groups = vcs_match.groupdict() if groups.get('login'): req.uri = '{scheme}://{login}@{path}'.format(**groups) else: req.uri = '{scheme}://{path}'.format(**groups) req.revision = groups['revision'] if groups['fragment']: fragment = parse_fragment(groups['fragment']) egg = fragment.get('egg') req.name, req.extras = parse_extras_require(egg) req.hash_name, req.hash = get_hash_info(fragment) req.subdirectory = fragment.get('subdirectory') for vcs in VCS: if req.uri.startswith(vcs): req.vcs = vcs elif uri_match is not None: groups = uri_match.groupdict() req.uri = '{scheme}://{path}'.format(**groups) if groups['fragment']: fragment = parse_fragment(groups['fragment']) egg = fragment.get('egg') req.name, req.extras = parse_extras_require(egg) req.hash_name, req.hash = get_hash_info(fragment) req.subdirectory = fragment.get('subdirectory') if groups['scheme'] == 'file': req.local_file = True elif '#egg=' in line: # Assume a local file match assert local_match is not None, 'This should match everything' groups = local_match.groupdict() req.local_file = True if groups['fragment']: fragment = parse_fragment(groups['fragment']) egg = fragment.get('egg') name, extras = parse_extras_require(egg) req.name = fragment.get('egg') req.hash_name, req.hash = get_hash_info(fragment) req.subdirectory = fragment.get('subdirectory') req.path = groups['path'] else: # This is a requirement specifier. # Delegate to pkg_resources and hope for the best req.specifier = True pkg_req = Req.parse(line) req.name = pkg_req.unsafe_name req.extras = list(pkg_req.extras) req.specs = pkg_req.specs return req @classmethod def parse(cls, line): """ Parses a Requirement from a line of a requirement file. :param line: a line of a requirement file :returns: a Requirement instance for the given line :raises: ValueError on an invalid requirement """ if line.startswith('-e') or line.startswith('--editable'): # Editable installs are either a local project path # or a VCS project URI return cls.parse_editable( re.sub(r'^(-e|--editable=?)\s*', '', line)) return cls.parse_line(line) requirements-parser-0.2.0/requirements/vcs.py000066400000000000000000000006251322603545100214220ustar00rootroot00000000000000from __future__ import unicode_literals VCS = [ 'git', 'hg', 'svn', 'bzr', ] VCS_SCHEMES = [ 'git', 'git+https', 'git+ssh', 'git+git', 'hg+http', 'hg+https', 'hg+static-http', 'hg+ssh', 'svn', 'svn+svn', 'svn+http', 'svn+https', 'svn+ssh', 'bzr+http', 'bzr+https', 'bzr+ssh', 'bzr+sftp', 'bzr+ftp', 'bzr+lp', ] requirements-parser-0.2.0/setup.py000066400000000000000000000025461322603545100172500ustar00rootroot00000000000000try: from setuptools import setup except ImportError: from distutils import setup import warnings warnings('Please install setuptools or distribute!') # Workaround for http://bugs.python.org/issue15881#msg170215 try: import multiprocessing # noqa except ImportError: pass long_description = open('README.rst').read() setup( name='requirements-parser', version='0.2.0', description='Parses Pip requirement files', long_description=long_description, author='David Fischer', author_email='djfische@gmail.com', url='https://github.com/davidfischer/requirements-parser', license='BSD', platforms=['OS Independent'], packages=['requirements'], classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries :: Python Modules', ], tests_require=['nose'], test_suite='nose.collector', ) requirements-parser-0.2.0/tests/000077500000000000000000000000001322603545100166715ustar00rootroot00000000000000requirements-parser-0.2.0/tests/__init__.py000066400000000000000000000000001322603545100207700ustar00rootroot00000000000000requirements-parser-0.2.0/tests/reqfiles/000077500000000000000000000000001322603545100205035ustar00rootroot00000000000000requirements-parser-0.2.0/tests/reqfiles/blank_1.expected000066400000000000000000000000021322603545100235250ustar00rootroot00000000000000[]requirements-parser-0.2.0/tests/reqfiles/blank_1.txt000066400000000000000000000000031322603545100225440ustar00rootroot00000000000000 requirements-parser-0.2.0/tests/reqfiles/comment_1.expected000066400000000000000000000000021322603545100241000ustar00rootroot00000000000000[]requirements-parser-0.2.0/tests/reqfiles/comment_1.txt000066400000000000000000000000241322603545100231220ustar00rootroot00000000000000# This is a comment requirements-parser-0.2.0/tests/reqfiles/comment_2.expected000066400000000000000000000004761322603545100241200ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "req", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "req==1.0 # comment", "hash_name": null, "hash": null, "specs": [ [ "==", "1.0" ] ], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/comment_2.txt000066400000000000000000000000261322603545100231250ustar00rootroot00000000000000req==1.0 # comment requirements-parser-0.2.0/tests/reqfiles/crateio_requirements.expected000066400000000000000000000501221322603545100264570ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "Babel", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Babel==0.9.6", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.6" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "Django", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Django==1.4", "hash_name": null, "hash": null, "specs": [ [ "==", "1.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "Jinja2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Jinja2==2.6", "hash_name": null, "hash": null, "specs": [ [ "==", "2.6" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "MarkupSafe", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "MarkupSafe==0.15", "hash_name": null, "hash": null, "specs": [ [ "==", "0.15" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "South", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "South==0.7.5", "hash_name": null, "hash": null, "specs": [ [ "==", "0.7.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "amqplib", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "amqplib==1.0.2", "hash_name": null, "hash": null, "specs": [ [ "==", "1.0.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "anyjson", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "anyjson==0.3.3", "hash_name": null, "hash": null, "specs": [ [ "==", "0.3.3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "bleach", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "bleach==1.1.1", "hash_name": null, "hash": null, "specs": [ [ "==", "1.1.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "boto", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "boto==2.3.0", "hash_name": null, "hash": null, "specs": [ [ "==", "2.3.0" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "celery", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "celery==2.5.5", "hash_name": null, "hash": null, "specs": [ [ "==", "2.5.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "celery-haystack", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "celery-haystack==0.4", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "certifi", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "certifi==0.0.8", "hash_name": null, "hash": null, "specs": [ [ "==", "0.0.8" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "chardet", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "chardet==1.0.1", "hash_name": null, "hash": null, "specs": [ [ "==", "1.0.1" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "crate.web", "editable": true, "subdirectory": null, "uri": "git+https://github.com/crateio/crate.web.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/crateio/crate.web.git#egg=crate.web", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "crate.pypi", "editable": true, "subdirectory": null, "uri": "git+https://github.com/crateio/crate.pypi.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/crateio/crate.pypi.git#egg=crate.pypi", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "eventlet", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "eventlet==0.9.16", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.16" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-admin-tools", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-admin-tools==0.4.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-appconf", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-appconf==0.5", "hash_name": null, "hash": null, "specs": [ [ "==", "0.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-celery", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-celery==2.5.5", "hash_name": null, "hash": null, "specs": [ [ "==", "2.5.5" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "django-haystack", "editable": true, "subdirectory": null, "uri": "git+https://github.com/toastdriven/django-haystack.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/toastdriven/django-haystack.git#egg=django-haystack", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "django-hosts", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-hosts==0.4.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-jsonfield", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-jsonfield==0.8.7", "hash_name": null, "hash": null, "specs": [ [ "==", "0.8.7" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-model-utils", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-model-utils==1.1.0", "hash_name": null, "hash": null, "specs": [ [ "==", "1.1.0" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-picklefield", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-picklefield==0.2.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.2.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-redis-cache", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-redis-cache==0.9.3", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-secure", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-secure==0.1.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.1.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-social-auth", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-social-auth==0.6.9", "hash_name": null, "hash": null, "specs": [ [ "==", "0.6.9" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-staticfiles", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-staticfiles==1.2.1", "hash_name": null, "hash": null, "specs": [ [ "==", "1.2.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-storages", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-storages==1.1.4", "hash_name": null, "hash": null, "specs": [ [ "==", "1.1.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-tastypie", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-tastypie==0.9.11", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.11" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "django-user-accounts", "editable": true, "subdirectory": null, "uri": "git://github.com/dstufft/django-user-accounts.git", "extras": [], "vcs": "git", "path": null, "line": "-e git://github.com/dstufft/django-user-accounts.git#egg=django-user-accounts", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "django-uuidfield", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-uuidfield==0.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "docutils", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "docutils==0.9.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "greenlet", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "greenlet==0.4.0", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4.0" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "gunicorn", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "gunicorn==0.14.5", "hash_name": null, "hash": null, "specs": [ [ "==", "0.14.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "html5lib", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "html5lib==0.95", "hash_name": null, "hash": null, "specs": [ [ "==", "0.95" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "httplib2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "httplib2==0.7.4", "hash_name": null, "hash": null, "specs": [ [ "==", "0.7.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "isoweek", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "isoweek==1.2.0", "hash_name": null, "hash": null, "specs": [ [ "==", "1.2.0" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "jingo", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "jingo==0.4", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "jutils", "editable": true, "subdirectory": null, "uri": "git+https://github.com/dstufft/jutils.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/dstufft/jutils.git#egg=jutils", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "kombu", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "kombu==2.1.8", "hash_name": null, "hash": null, "specs": [ [ "==", "2.1.8" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "lxml", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "lxml==2.3.4", "hash_name": null, "hash": null, "specs": [ [ "==", "2.3.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "mimeparse", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "mimeparse==0.1.3", "hash_name": null, "hash": null, "specs": [ [ "==", "0.1.3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "newrelic", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "newrelic==1.2.1.265", "hash_name": null, "hash": null, "specs": [ [ "==", "1.2.1.265" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "oauth2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "oauth2==1.5.211", "hash_name": null, "hash": null, "specs": [ [ "==", "1.5.211" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "oauthlib", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "oauthlib==0.1.3", "hash_name": null, "hash": null, "specs": [ [ "==", "0.1.3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "pinax-utils", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "pinax-utils==1.0b1.dev3", "hash_name": null, "hash": null, "specs": [ [ "==", "1.0b1.dev3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "psycopg2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "psycopg2==2.4.5", "hash_name": null, "hash": null, "specs": [ [ "==", "2.4.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "py-bcrypt", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "py-bcrypt==0.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "pyasn1", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "pyasn1==0.1.3", "hash_name": null, "hash": null, "specs": [ [ "==", "0.1.3" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "pyelasticsearch", "editable": true, "subdirectory": null, "uri": "git+https://github.com/toastdriven/pyelasticsearch.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/toastdriven/pyelasticsearch.git#egg=pyelasticsearch", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "python-dateutil", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "python-dateutil==1.5", "hash_name": null, "hash": null, "specs": [ [ "==", "1.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "python-openid", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "python-openid==2.2.5", "hash_name": null, "hash": null, "specs": [ [ "==", "2.2.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "pytz", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "pytz==2012c", "hash_name": null, "hash": null, "specs": [ [ "==", "2012c" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "PyYAML", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "PyYAML==3.10", "hash_name": null, "hash": null, "specs": [ [ "==", "3.10" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "raven", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "raven==1.7.6", "hash_name": null, "hash": null, "specs": [ [ "==", "1.7.6" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "redis", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "redis==2.4.12", "hash_name": null, "hash": null, "specs": [ [ "==", "2.4.12" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "requests", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "requests==0.12.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.12.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "rsa", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "rsa==3.0.1", "hash_name": null, "hash": null, "specs": [ [ "==", "3.0.1" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "saved_searches", "editable": true, "subdirectory": null, "uri": "git+https://github.com/toastdriven/saved_searches.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/toastdriven/saved_searches.git#egg=saved_searches", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "simplejson", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "simplejson==2.5.2", "hash_name": null, "hash": null, "specs": [ [ "==", "2.5.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "slumber", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "slumber==0.4.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "uuid", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "uuid==1.30", "hash_name": null, "hash": null, "specs": [ [ "==", "1.30" ] ], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/crateio_requirements.txt000066400000000000000000000055051322603545100255020ustar00rootroot00000000000000# Copyright (c) 2012, Crate and individual contributors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --extra-index-url=http://dist.pinaxproject.com/dev/ Babel==0.9.6 Django==1.4 Jinja2==2.6 MarkupSafe==0.15 South==0.7.5 amqplib==1.0.2 anyjson==0.3.3 bleach==1.1.1 boto==2.3.0 celery==2.5.5 celery-haystack==0.4 certifi==0.0.8 chardet==1.0.1 -e git+https://github.com/crateio/crate.web.git#egg=crate.web -e git+https://github.com/crateio/crate.pypi.git#egg=crate.pypi eventlet==0.9.16 django-admin-tools==0.4.1 django-appconf==0.5 django-celery==2.5.5 -e git+https://github.com/toastdriven/django-haystack.git#egg=django-haystack django-hosts==0.4.2 django-jsonfield==0.8.7 django-model-utils==1.1.0 django-picklefield==0.2.1 django-redis-cache==0.9.3 django-secure==0.1.2 django-social-auth==0.6.9 django-staticfiles==1.2.1 django-storages==1.1.4 django-tastypie==0.9.11 -e git://github.com/dstufft/django-user-accounts.git#egg=django-user-accounts django-uuidfield==0.2 docutils==0.9.1 greenlet==0.4.0 gunicorn==0.14.5 html5lib==0.95 httplib2==0.7.4 isoweek==1.2.0 jingo==0.4 -e git+https://github.com/dstufft/jutils.git#egg=jutils kombu==2.1.8 lxml==2.3.4 mimeparse==0.1.3 newrelic==1.2.1.265 oauth2==1.5.211 oauthlib==0.1.3 pinax-utils==1.0b1.dev3 psycopg2==2.4.5 py-bcrypt==0.2 pyasn1==0.1.3 -e git+https://github.com/toastdriven/pyelasticsearch.git#egg=pyelasticsearch python-dateutil==1.5 python-openid==2.2.5 pytz==2012c PyYAML==3.10 raven==1.7.6 redis==2.4.12 requests==0.12.1 rsa==3.0.1 -e git+https://github.com/toastdriven/saved_searches.git#egg=saved_searches simplejson==2.5.2 slumber==0.4.2 uuid==1.30 requirements-parser-0.2.0/tests/reqfiles/editable_1.expected000066400000000000000000000027441322603545100242260ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "svn+svn://svn.myproject.org/svn/MyProject", "extras": [], "vcs": "svn", "path": null, "line": "-e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "-e git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "da39a3ee5e6b4b0d3255bfef95601890afd80709" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject/", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "special_feature" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+lp://MyProject", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+lp://MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/editable_1.txt000066400000000000000000000004261322603545100232370ustar00rootroot00000000000000-e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject --editable git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject --editable hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject -e bzr+lp://MyProject#egg=MyProject requirements-parser-0.2.0/tests/reqfiles/extras_1.expected000066400000000000000000000011731322603545100237560ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "MyPackage", "editable": false, "subdirectory": null, "uri": null, "extras": [ "pdf" ], "vcs": null, "path": null, "line": "MyPackage[PDF]==3.0", "hash_name": null, "hash": null, "specs": [ [ "==", "3.0" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "Fizzy", "editable": false, "subdirectory": null, "uri": null, "extras": [ "bar", "foo" ], "vcs": null, "path": null, "line": "Fizzy [foo, bar]", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/extras_1.txt000066400000000000000000000000451322603545100227710ustar00rootroot00000000000000MyPackage[PDF]==3.0 Fizzy [foo, bar] requirements-parser-0.2.0/tests/reqfiles/fail_1.txt000066400000000000000000000000301322603545100223700ustar00rootroot00000000000000test>>1.2.0 test=>1.2.0 requirements-parser-0.2.0/tests/reqfiles/fail_2.txt000066400000000000000000000000721322603545100223770ustar00rootroot00000000000000novcs+http://example.com#egg=a svn+http://example.com#egg requirements-parser-0.2.0/tests/reqfiles/file_1.expected000066400000000000000000000024731322603545100233730ustar00rootroot00000000000000[ { "specifier": false, "local_file": true, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "file:///path/to/your/lib/project", "extras": [], "vcs": null, "path": null, "line": "file:///path/to/your/lib/project#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": true, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "file://../../lib/project", "extras": [], "vcs": null, "path": null, "line": "file://../../lib/project#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": true, "name": "SomeOtherProject", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": "path/to/SomeProject", "line": "path/to/SomeProject#egg=SomeOtherProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "editable": true, "subdirectory": null, "extras": [], "line": "-e path/to/AnotherProject#egg=AnotherProject", "hash_name": null, "hash": null, "local_file": true, "name": "AnotherProject", "path": "path/to/AnotherProject", "revision": null, "specifier": false, "specs": [], "uri": null, "vcs": null } ] requirements-parser-0.2.0/tests/reqfiles/file_1.txt000066400000000000000000000002541322603545100224040ustar00rootroot00000000000000file:///path/to/your/lib/project#egg=MyProject file://../../lib/project#egg=MyProject path/to/SomeProject#egg=SomeOtherProject -e path/to/AnotherProject#egg=AnotherProject requirements-parser-0.2.0/tests/reqfiles/illustrative_requirements.expected000066400000000000000000000024451322603545100275650ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "requirements", "editable": true, "subdirectory": null, "uri": "git+https://github.com/davidfischer/requirements-parser.git", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://github.com/davidfischer/requirements-parser.git#egg=requirements", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "Django", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Django >=1.5, <1.6", "hash_name": null, "hash": null, "specs": [ [ "<", "1.6" ], [ ">=", "1.5" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "numpy", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "numpy", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "DocParser", "editable": false, "subdirectory": null, "uri": null, "extras": [ "pdf" ], "vcs": null, "path": null, "line": "DocParser [PDF]", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/illustrative_requirements.txt000066400000000000000000000001711322603545100265750ustar00rootroot00000000000000-e git+https://github.com/davidfischer/requirements-parser.git#egg=requirements Django >=1.5, <1.6 numpy DocParser [PDF] requirements-parser-0.2.0/tests/reqfiles/recursive_1.expected000066400000000000000000000016641322603545100244640ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "ipdb", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "ipdb", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "Jinja", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Jinja", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "Django", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Django==1.6", "hash_name": null, "hash": null, "specs": [ [ "==", "1.6" ] ], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/recursive_1.txt000066400000000000000000000000361322603545100234720ustar00rootroot00000000000000-r recursive_2.txt Django==1.6requirements-parser-0.2.0/tests/reqfiles/recursive_2.expected000066400000000000000000000011231322603545100244530ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "ipdb", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "ipdb", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "Jinja", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Jinja", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/recursive_2.txt000066400000000000000000000000301322603545100234650ustar00rootroot00000000000000-r recursive_3.txt Jinjarequirements-parser-0.2.0/tests/reqfiles/recursive_3.expected000066400000000000000000000005471322603545100244650ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "ipdb", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "ipdb", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/recursive_3.txt000066400000000000000000000000041322603545100234670ustar00rootroot00000000000000ipdbrequirements-parser-0.2.0/tests/reqfiles/rtfd_deploy_requirements.expected000066400000000000000000000025531322603545100273510ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "psycopg2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "psycopg2", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "gunicorn", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "gunicorn", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "pysolr", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "pysolr", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "python-memcached", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "python-memcached", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "dnspython", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "dnspython", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/rtfd_deploy_requirements.txt000066400000000000000000000022401322603545100263600ustar00rootroot00000000000000# Copyright (c) 2011 Charles Leifer, Eric Holscher, Bobby Grace # # 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. psycopg2 gunicorn pysolr python-memcached dnspython requirements-parser-0.2.0/tests/reqfiles/rtfd_requirements.expected000066400000000000000000000252151322603545100257750ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "Distutils2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Distutils2==1.0a3", "hash_name": null, "hash": null, "specs": [ [ "==", "1.0a3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "Sphinx", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Sphinx==1.1.2", "hash_name": null, "hash": null, "specs": [ [ "==", "1.1.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "Unipath", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Unipath==0.2.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.2.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "bzr", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "bzr==2.5b4", "hash_name": null, "hash": null, "specs": [ [ "==", "2.5b4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "celery-haystack", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "celery-haystack==0.6.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.6.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "celery", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "celery==3.0.9", "hash_name": null, "hash": null, "specs": [ [ "==", "3.0.9" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-celery", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-celery==3.0.9", "hash_name": null, "hash": null, "specs": [ [ "==", "3.0.9" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-extensions", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-extensions==0.7.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.7.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-guardian", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-guardian==1.0.4", "hash_name": null, "hash": null, "specs": [ [ "==", "1.0.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-kombu", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-kombu==0.9.4", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-profiles", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-profiles==0.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django-secure", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django-secure==0.1.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.1.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "django", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "django==1.4.2", "hash_name": null, "hash": null, "specs": [ [ "==", "1.4.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "docutils", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "docutils==0.8.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.8.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "github2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "github2==0.5.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.5.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "httplib2", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "httplib2==0.7.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.7.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "mercurial", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "mercurial==2.4", "hash_name": null, "hash": null, "specs": [ [ "==", "2.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "mimeparse", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "mimeparse==0.1.3", "hash_name": null, "hash": null, "specs": [ [ "==", "0.1.3" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "redis", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "redis==2.7.1", "hash_name": null, "hash": null, "specs": [ [ "==", "2.7.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "simplejson", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "simplejson==2.3.0", "hash_name": null, "hash": null, "specs": [ [ "==", "2.3.0" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "slumber", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "slumber==0.4.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "south", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "south==0.7.6", "hash_name": null, "hash": null, "specs": [ [ "==", "0.7.6" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "sphinx-http-domain", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "sphinx-http-domain==0.2", "hash_name": null, "hash": null, "specs": [ [ "==", "0.2" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "unittest-xml-reporting", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "unittest-xml-reporting==1.3.1", "hash_name": null, "hash": null, "specs": [ [ "==", "1.3.1" ] ], "revision": null }, { "specifier": false, "local_file": false, "name": "django_haystack", "editable": false, "subdirectory": null, "uri": "git+git://github.com/toastdriven/django-haystack", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack", "hash_name": null, "hash": null, "specs": [], "revision": "259274e4127f723d76b893c87a82777f9490b960" }, { "specifier": false, "local_file": false, "name": "django-filter", "editable": false, "subdirectory": null, "uri": "git+git://github.com/alex/django-filter.git", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/alex/django-filter.git#egg=django-filter", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "django_taggit-dev", "editable": false, "subdirectory": null, "uri": "git+git://github.com/alex/django-taggit.git", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/alex/django-taggit.git@36f6dabcf10e27c7d9442a94243d4189f2a4f121#egg=django_taggit-dev", "hash_name": null, "hash": null, "specs": [], "revision": "36f6dabcf10e27c7d9442a94243d4189f2a4f121" }, { "specifier": false, "local_file": false, "name": "django_pagination-dev", "editable": false, "subdirectory": null, "uri": "git+git://github.com/ericflo/django-pagination.git", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/ericflo/django-pagination.git@e5f669036c#egg=django_pagination-dev", "hash_name": null, "hash": null, "specs": [], "revision": "e5f669036c" }, { "specifier": false, "local_file": false, "name": "django_basic_apps-dev", "editable": false, "subdirectory": null, "uri": "git+git://github.com/nathanborror/django-basic-apps.git", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/nathanborror/django-basic-apps.git@171fdbe21a0dbbb38919a383cc265cb3cbc73771#egg=django_basic_apps-dev", "hash_name": null, "hash": null, "specs": [], "revision": "171fdbe21a0dbbb38919a383cc265cb3cbc73771" }, { "specifier": false, "local_file": false, "name": "django_registration-dev", "editable": false, "subdirectory": null, "uri": "git+git://github.com/nathanborror/django-registration.git", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/nathanborror/django-registration.git@dc0b564b7bfb79f58592fe8ad836729a85ec17ae#egg=django_registration-dev", "hash_name": null, "hash": null, "specs": [], "revision": "dc0b564b7bfb79f58592fe8ad836729a85ec17ae" }, { "specifier": false, "local_file": false, "name": "django_tastypie-dev", "editable": false, "subdirectory": null, "uri": "git+git://github.com/toastdriven/django-tastypie.git", "extras": [], "vcs": "git", "path": null, "line": "git+git://github.com/toastdriven/django-tastypie.git@c5451b90b18b0cb64841b2276d543230d5f58231#egg=django_tastypie-dev", "hash_name": null, "hash": null, "specs": [], "revision": "c5451b90b18b0cb64841b2276d543230d5f58231" } ] requirements-parser-0.2.0/tests/reqfiles/rtfd_requirements.txt000066400000000000000000000044451322603545100250150ustar00rootroot00000000000000# Copyright (c) 2011 Charles Leifer, Eric Holscher, Bobby Grace # # 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. # Pypi ftw. Distutils2==1.0a3 Sphinx==1.1.2 Unipath==0.2.1 bzr==2.5b4 celery-haystack==0.6.2 celery==3.0.9 django-celery==3.0.9 django-extensions==0.7.1 django-guardian==1.0.4 django-kombu==0.9.4 django-profiles==0.2 django-secure==0.1.2 django==1.4.2 docutils==0.8.1 github2==0.5.2 httplib2==0.7.2 mercurial==2.4 mimeparse==0.1.3 redis==2.7.1 simplejson==2.3.0 slumber==0.4.2 south==0.7.6 sphinx-http-domain==0.2 unittest-xml-reporting==1.3.1 # Pegged git requirements git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack git+git://github.com/alex/django-filter.git#egg=django-filter git+git://github.com/alex/django-taggit.git@36f6dabcf10e27c7d9442a94243d4189f2a4f121#egg=django_taggit-dev git+git://github.com/ericflo/django-pagination.git@e5f669036c#egg=django_pagination-dev git+git://github.com/nathanborror/django-basic-apps.git@171fdbe21a0dbbb38919a383cc265cb3cbc73771#egg=django_basic_apps-dev git+git://github.com/nathanborror/django-registration.git@dc0b564b7bfb79f58592fe8ad836729a85ec17ae#egg=django_registration-dev git+git://github.com/toastdriven/django-tastypie.git@c5451b90b18b0cb64841b2276d543230d5f58231#egg=django_tastypie-dev requirements-parser-0.2.0/tests/reqfiles/simple_1.expected000066400000000000000000000023321322603545100237370ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "z3c.checkversions", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "z3c.checkversions==0.4.1", "hash_name": null, "hash": null, "specs": [ [ "==", "0.4.1" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "MyPackage", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "MyPackage", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": true, "local_file": false, "name": "Framework", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Framework==0.9.4", "hash_name": null, "hash": null, "specs": [ [ "==", "0.9.4" ] ], "revision": null }, { "specifier": true, "local_file": false, "name": "Library", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "Library>=0.2", "hash_name": null, "hash": null, "specs": [ [ ">=", "0.2" ] ], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/simple_1.txt000066400000000000000000000001011322603545100227450ustar00rootroot00000000000000z3c.checkversions==0.4.1 MyPackage Framework==0.9.4 Library>=0.2 requirements-parser-0.2.0/tests/reqfiles/specs_1.expected000066400000000000000000000006301322603545100235620ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "PickyThing", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1", "hash_name": null, "hash": null, "specs": [ ["!=", "1.9.6"], ["<", "1.6"], ["<", "2.0a0"], ["==", "2.4c1"], [">", "1.9"] ], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/specs_1.txt000066400000000000000000000000531322603545100225770ustar00rootroot00000000000000PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1 requirements-parser-0.2.0/tests/reqfiles/subdirectory.expected000066400000000000000000000013671322603545100247530ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": "setup", "uri": "git+git://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "-e git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": "setup", "uri": "git+git://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup", "hash_name": null, "hash": null, "specs": [], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/subdirectory.txt000066400000000000000000000002211322603545100237550ustar00rootroot00000000000000-e git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup requirements-parser-0.2.0/tests/reqfiles/underscores.expected000066400000000000000000000004611322603545100245630ustar00rootroot00000000000000[ { "specifier": true, "local_file": false, "name": "a_b", "editable": false, "subdirectory": null, "uri": null, "extras": [], "vcs": null, "path": null, "line": "a_b>=1.0", "hash_name": null, "hash": null, "specs": [ [ ">=", "1.0" ] ], "revision": null } ] requirements-parser-0.2.0/tests/reqfiles/underscores.txt000066400000000000000000000000111322603545100235700ustar00rootroot00000000000000a_b>=1.0 requirements-parser-0.2.0/tests/reqfiles/uri.expected000066400000000000000000000016361322603545100230330ustar00rootroot00000000000000[ { "editable": false, "extras": [], "line": "http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97", "hash_name": "md5", "hash": "a3316cf3842ed0375ba5931914239d97", "local_file": false, "name": null, "path": null, "revision": null, "specifier": false, "specs": [], "subdirectory": null, "uri": "http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz", "vcs": null }, { "editable": false, "extras": [], "line": "http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask", "hash_name": "sha256", "hash": "1212aaf123911123babc024abaa", "local_file": false, "name": "Flask", "path": null, "revision": null, "specifier": false, "specs": [], "subdirectory": null, "uri": "http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz", "vcs": null } ] requirements-parser-0.2.0/tests/reqfiles/uri.txt000066400000000000000000000003261322603545100220440ustar00rootroot00000000000000http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97 http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask requirements-parser-0.2.0/tests/reqfiles/vcs_bzr.expected000066400000000000000000000105771322603545100237100ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+http://bzr.myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+sftp://user@myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+ssh://user@myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+ftp://user@myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+https://bzr.myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "2019" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "bzr+http://bzr.myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "-e bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "v1.0" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "bzr+http://bzr.myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "bzr+sftp://user@myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "bzr+ssh://user@myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "bzr+ftp://user@myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "bzr+https://bzr.myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "2019" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "bzr+http://bzr.myproject.org/MyProject/trunk", "extras": [], "vcs": "bzr", "path": null, "line": "bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "v1.0" } ] requirements-parser-0.2.0/tests/reqfiles/vcs_bzr.txt000066400000000000000000000013571322603545100227220ustar00rootroot00000000000000-e bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject -e bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject -e bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject -e bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject -e bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject -e bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject requirements-parser-0.2.0/tests/reqfiles/vcs_git.expected000066400000000000000000000113521322603545100236660ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git+git://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "-e git+git://git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git+https://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "-e git+https://git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git+ssh://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "-e git+ssh://git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git+ssh://git@git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "-e git+ssh://git@git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "-e git://git.myproject.org/MyProject.git@master#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "master" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "-e git://git.myproject.org/MyProject.git@v1.0#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "v1.0" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "-e git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "da39a3ee5e6b4b0d3255bfef95601890afd80709" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git+git://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "git+git://git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git+https://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "git+https://git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git+ssh://git.myproject.org/MyProject", "extras": [], "vcs": "git", "path": null, "line": "git+ssh://git.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "git://git.myproject.org/MyProject.git@master#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "master" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "git://git.myproject.org/MyProject.git@v1.0#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "v1.0" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git://git.myproject.org/MyProject.git", "extras": [], "vcs": "git", "path": null, "line": "git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "da39a3ee5e6b4b0d3255bfef95601890afd80709" } ] requirements-parser-0.2.0/tests/reqfiles/vcs_git.txt000066400000000000000000000014541322603545100227060ustar00rootroot00000000000000-e git+git://git.myproject.org/MyProject#egg=MyProject -e git+https://git.myproject.org/MyProject#egg=MyProject -e git+ssh://git.myproject.org/MyProject#egg=MyProject -e git+ssh://git@git.myproject.org/MyProject#egg=MyProject -e git://git.myproject.org/MyProject.git@master#egg=MyProject -e git://git.myproject.org/MyProject.git@v1.0#egg=MyProject -e git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject git+git://git.myproject.org/MyProject#egg=MyProject git+https://git.myproject.org/MyProject#egg=MyProject git+ssh://git.myproject.org/MyProject#egg=MyProject git://git.myproject.org/MyProject.git@master#egg=MyProject git://git.myproject.org/MyProject.git@v1.0#egg=MyProject git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject requirements-parser-0.2.0/tests/reqfiles/vcs_git_extras_require.expected000066400000000000000000000006151322603545100270100ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "git+https://git.myproject.org/MyProject.git", "extras": ["security"], "vcs": "git", "path": null, "line": "git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security]", "hash_name": null, "hash": null, "specs": [], "revision": "v0.1" } ] requirements-parser-0.2.0/tests/reqfiles/vcs_git_extras_require.txt000066400000000000000000000001111322603545100260150ustar00rootroot00000000000000git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security] requirements-parser-0.2.0/tests/reqfiles/vcs_hg.expected000066400000000000000000000117261322603545100235060ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+http://hg.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+https://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+https://hg.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+ssh://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+ssh://hg.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "da39a3ee5e6b" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+http://hg.myproject.org/MyProject@2019#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "2019" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "v1.0" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "-e hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "special_feature" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+http://hg.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+https://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+https://hg.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+ssh://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+ssh://hg.myproject.org/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "da39a3ee5e6b" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+http://hg.myproject.org/MyProject@2019#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "2019" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "v1.0" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "hg+http://hg.myproject.org/MyProject", "extras": [], "vcs": "hg", "path": null, "line": "hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "special_feature" } ] requirements-parser-0.2.0/tests/reqfiles/vcs_hg.txt000066400000000000000000000014561322603545100225230ustar00rootroot00000000000000-e hg+http://hg.myproject.org/MyProject#egg=MyProject -e hg+https://hg.myproject.org/MyProject#egg=MyProject -e hg+ssh://hg.myproject.org/MyProject#egg=MyProject -e hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject -e hg+http://hg.myproject.org/MyProject@2019#egg=MyProject -e hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject -e hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject hg+http://hg.myproject.org/MyProject#egg=MyProject hg+https://hg.myproject.org/MyProject#egg=MyProject hg+ssh://hg.myproject.org/MyProject#egg=MyProject hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject hg+http://hg.myproject.org/MyProject@2019#egg=MyProject hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject requirements-parser-0.2.0/tests/reqfiles/vcs_svn.expected000066400000000000000000000027361322603545100237170ustar00rootroot00000000000000[ { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "svn+svn://svn.myproject.org/svn/MyProject", "extras": [], "vcs": "svn", "path": null, "line": "-e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": true, "subdirectory": null, "uri": "svn+http://svn.myproject.org/svn/MyProject/trunk", "extras": [], "vcs": "svn", "path": null, "line": "-e svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "2019" }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "svn+svn://svn.myproject.org/svn/MyProject", "extras": [], "vcs": "svn", "path": null, "line": "svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": null }, { "specifier": false, "local_file": false, "name": "MyProject", "editable": false, "subdirectory": null, "uri": "svn+http://svn.myproject.org/svn/MyProject/trunk", "extras": [], "vcs": "svn", "path": null, "line": "svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject", "hash_name": null, "hash": null, "specs": [], "revision": "2019" } ] requirements-parser-0.2.0/tests/reqfiles/vcs_svn.txt000066400000000000000000000003771322603545100227340ustar00rootroot00000000000000-e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject -e svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject requirements-parser-0.2.0/tests/test_parser.py000066400000000000000000000033211322603545100215750ustar00rootroot00000000000000import os import json from nose.tools import raises, assert_equal import warnings from requirements import parse REQFILE_DIR = os.path.join(os.path.dirname(__file__), 'reqfiles') def listify(iterable): out = [] for item in iterable: if isinstance(item, dict): for key, value in item.items(): if isinstance(item[key], (tuple, list)): if key in ('extras', 'specs'): # enforce predictability item[key] = sorted(listify(value)) else: item[key] = listify(value) elif isinstance(item, (tuple, list)): item = listify(item) out.append(item) return out def test_requirement_files(): for fn in os.listdir(REQFILE_DIR): def fancy(f): f.description = "%s.%s: %s" % (f.__module__, f.__name__, fn) return f @fancy @raises(ValueError) def check_fail(s): with warnings.catch_warnings(): warnings.simplefilter("ignore") list([dict(r) for r in parse(s)]) @fancy def check(s, expected): with warnings.catch_warnings(): warnings.simplefilter("ignore") assert_equal(listify(dict(r) for r in parse(s)), expected) fp = os.path.join(REQFILE_DIR, fn) # skip ".expected" files if not os.path.isfile(fp) or not fp.endswith('.txt'): continue if 'fail' in fn: yield check_fail, open(fp) else: with open(fp[:-4] + '.expected', 'r') as f2: expected = json.loads(f2.read()) yield check, open(fp), expected