├── .gitattributes ├── .github └── workflows │ ├── docs-ci.yml │ └── pypi-release.yml ├── .gitignore ├── .readthedocs.yml ├── AUTHORS.rst ├── AUTHORS.txt ├── CHANGELOG.rst ├── CODE_OF_CONDUCT.rst ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.rst ├── apache-2.0.LICENSE ├── azure-pipelines.yml ├── configure ├── configure.bat ├── docs ├── Makefile ├── make.bat ├── scripts │ ├── doc8_style_check.sh │ └── sphinx_build_link_check.sh └── source │ ├── _static │ └── theme_overrides.css │ ├── conf.py │ ├── contribute │ └── contrib_doc.rst │ ├── index.rst │ └── skeleton-usage.rst ├── etc ├── README.rst ├── ci │ ├── azure-container-deb.yml │ ├── azure-container-rpm.yml │ ├── azure-posix.yml │ ├── azure-win.yml │ ├── install_sudo.sh │ ├── macports-ci │ ├── macports-ci.ABOUT │ └── mit.LICENSE ├── git-filter-repo-pip.sh ├── git-rename-merge.sh └── scripts │ ├── README.rst │ ├── check_thirdparty.py │ ├── fetch_thirdparty.py │ ├── gen_pypi_simple.py │ ├── gen_pypi_simple.py.ABOUT │ ├── gen_pypi_simple.py.NOTICE │ ├── gen_requirements.py │ ├── gen_requirements_dev.py │ ├── requirements.txt │ ├── test_utils_pip_compatibility_tags.py │ ├── test_utils_pip_compatibility_tags.py.ABOUT │ ├── test_utils_pypi_supported_tags.py │ ├── test_utils_pypi_supported_tags.py.ABOUT │ ├── utils_dejacode.py │ ├── utils_pip_compatibility_tags.py │ ├── utils_pip_compatibility_tags.py.ABOUT │ ├── utils_pypi_supported_tags.py │ ├── utils_pypi_supported_tags.py.ABOUT │ ├── utils_requirements.py │ ├── utils_thirdparty.py │ └── utils_thirdparty.py.ABOUT ├── mit.LICENSE ├── pyproject.toml ├── requirements-dev.txt ├── requirements.txt ├── setup.cfg ├── setup.py ├── src ├── packaging_legacy_version.py ├── packaging_legacy_version.py.ABOUT ├── packaging_legacy_version.py.LICENSE ├── packaging_legacy_version.py.LICENSE.APACHE ├── packaging_legacy_version.py.LICENSE.BSD └── pip_requirements_parser.py └── tests ├── conftest.py ├── pip_requirements_parser_tests ├── __init__.py ├── data │ ├── more-requirements │ │ ├── Alzon-senlin-requirements.txt │ │ ├── Alzon-senlin-requirements.txt-expected.dumps │ │ ├── Alzon-senlin-requirements.txt-expected.json │ │ ├── CyrilPeponnet-Unify-whisper-requirements.txt │ │ ├── CyrilPeponnet-Unify-whisper-requirements.txt-expected.dumps │ │ ├── CyrilPeponnet-Unify-whisper-requirements.txt-expected.json │ │ ├── Elchi3-kuma-requirements-dev.txt │ │ ├── Elchi3-kuma-requirements-dev.txt-expected.dumps │ │ ├── Elchi3-kuma-requirements-dev.txt-expected.json │ │ ├── TechAtNYU-overlord-requirements.txt │ │ ├── TechAtNYU-overlord-requirements.txt-expected.dumps │ │ ├── TechAtNYU-overlord-requirements.txt-expected.json │ │ ├── UQ-UQx-edx-platform_lti-requirements-edx-edx-private.txt │ │ ├── UQ-UQx-edx-platform_lti-requirements-edx-edx-private.txt-expected.dumps │ │ ├── UQ-UQx-edx-platform_lti-requirements-edx-edx-private.txt-expected.json │ │ ├── Winterflower-ibis-requirements.txt │ │ ├── Winterflower-ibis-requirements.txt-expected.dumps │ │ ├── Winterflower-ibis-requirements.txt-expected.json │ │ ├── alexandermendes-pybossa-github-builder-requirements.txt │ │ ├── alexandermendes-pybossa-github-builder-requirements.txt-expected.dumps │ │ ├── alexandermendes-pybossa-github-builder-requirements.txt-expected.json │ │ ├── andymckay-olympia-requirements-prod.txt │ │ ├── andymckay-olympia-requirements-prod.txt-expected.dumps │ │ ├── andymckay-olympia-requirements-prod.txt-expected.json │ │ ├── bigzachattack-dockerspawner-requirements.txt │ │ ├── bigzachattack-dockerspawner-requirements.txt-expected.dumps │ │ ├── bigzachattack-dockerspawner-requirements.txt-expected.json │ │ ├── brutus-templator-requirements.txt │ │ ├── brutus-templator-requirements.txt-expected.dumps │ │ ├── brutus-templator-requirements.txt-expected.json │ │ ├── buildtimetrend-python-client-requirements-native.txt │ │ ├── buildtimetrend-python-client-requirements-native.txt-expected.dumps │ │ ├── buildtimetrend-python-client-requirements-native.txt-expected.json │ │ ├── freedomsponsors-www.freedomsponsors.org-requirements.txt │ │ ├── freedomsponsors-www.freedomsponsors.org-requirements.txt-expected.dumps │ │ ├── freedomsponsors-www.freedomsponsors.org-requirements.txt-expected.json │ │ ├── freeekanayaka-systemfixtures-requirements.txt │ │ ├── freeekanayaka-systemfixtures-requirements.txt-expected.dumps │ │ ├── freeekanayaka-systemfixtures-requirements.txt-expected.json │ │ ├── indodutch-sim-city-webservice-requirements.txt │ │ ├── indodutch-sim-city-webservice-requirements.txt-expected.dumps │ │ ├── indodutch-sim-city-webservice-requirements.txt-expected.json │ │ ├── jacobzweig-RCNN_Toolbox-requirements.txt │ │ ├── jacobzweig-RCNN_Toolbox-requirements.txt-expected.dumps │ │ ├── jacobzweig-RCNN_Toolbox-requirements.txt-expected.json │ │ ├── jonaqp-django_mongo-requirements-req.txt │ │ ├── jonaqp-django_mongo-requirements-req.txt-expected.dumps │ │ ├── jonaqp-django_mongo-requirements-req.txt-expected.json │ │ ├── jorismathijssen-ProjectLipa-James-requirements.txt │ │ ├── jorismathijssen-ProjectLipa-James-requirements.txt-expected.dumps │ │ ├── jorismathijssen-ProjectLipa-James-requirements.txt-expected.json │ │ ├── maxgraser-seriesly-seriesly-requirements.txt │ │ ├── maxgraser-seriesly-seriesly-requirements.txt-expected.dumps │ │ ├── maxgraser-seriesly-seriesly-requirements.txt-expected.json │ │ ├── mbertrand-cga-worldmap-shared-dev-requirements.txt │ │ ├── mbertrand-cga-worldmap-shared-dev-requirements.txt-expected.dumps │ │ ├── mbertrand-cga-worldmap-shared-dev-requirements.txt-expected.json │ │ ├── ministryofjustice-elasticsearch-formula-formula-requirements.txt │ │ ├── ministryofjustice-elasticsearch-formula-formula-requirements.txt-expected.dumps │ │ ├── ministryofjustice-elasticsearch-formula-formula-requirements.txt-expected.json │ │ ├── nikdoof-test-auth-requirements.txt │ │ ├── nikdoof-test-auth-requirements.txt-expected.dumps │ │ ├── nikdoof-test-auth-requirements.txt-expected.json │ │ ├── pamfilos-invenio-requirements.txt │ │ ├── pamfilos-invenio-requirements.txt-expected.dumps │ │ ├── pamfilos-invenio-requirements.txt-expected.json │ │ ├── pvernier-elpaso-requirements.txt │ │ ├── pvernier-elpaso-requirements.txt-expected.dumps │ │ ├── pvernier-elpaso-requirements.txt-expected.json │ │ ├── qvazzler-Flexget-requirements.txt │ │ ├── qvazzler-Flexget-requirements.txt-expected.dumps │ │ ├── qvazzler-Flexget-requirements.txt-expected.json │ │ ├── rthieledesy-invenio-requirements-devel.txt │ │ ├── rthieledesy-invenio-requirements-devel.txt-expected.dumps │ │ ├── rthieledesy-invenio-requirements-devel.txt-expected.json │ │ ├── rustyrazorblade-machete-requirements.txt │ │ ├── rustyrazorblade-machete-requirements.txt-expected.dumps │ │ ├── rustyrazorblade-machete-requirements.txt-expected.json │ │ ├── ryansb-bookmarkd-requirements.txt │ │ ├── ryansb-bookmarkd-requirements.txt-expected.dumps │ │ ├── ryansb-bookmarkd-requirements.txt-expected.json │ │ ├── theatlantic-django-cache-machine-requirements.txt │ │ ├── theatlantic-django-cache-machine-requirements.txt-expected.dumps │ │ ├── theatlantic-django-cache-machine-requirements.txt-expected.json │ │ ├── vladikoff-loop-server-loadtests-requirements.txt │ │ ├── vladikoff-loop-server-loadtests-requirements.txt-expected.dumps │ │ └── vladikoff-loop-server-loadtests-requirements.txt-expected.json │ ├── reqfiles │ │ └── supported_options2.txt │ ├── requirements │ │ ├── packaging-docs-examples.txt │ │ ├── packaging-docs-examples.txt-expected.dumps │ │ ├── packaging-docs-examples.txt-expected.json │ │ ├── pep-508-examples.txt │ │ ├── pep-508-examples.txt-expected.dumps │ │ ├── pep-508-examples.txt-expected.json │ │ ├── pip-docs-examples-vcs.txt │ │ ├── pip-docs-examples-vcs.txt-expected.dumps │ │ ├── pip-docs-examples-vcs.txt-expected.json │ │ ├── pip-docs-examples.txt │ │ ├── pip-docs-examples.txt-expected.dumps │ │ ├── pip-docs-examples.txt-expected.json │ │ ├── pip-docs-examples2.txt │ │ ├── pip-docs-examples2.txt-expected.dumps │ │ ├── pip-docs-examples2.txt-expected.json │ │ ├── pip-docs-examples3.txt │ │ ├── pip-docs-examples3.txt-expected.dumps │ │ ├── pip-docs-examples3.txt-expected.json │ │ ├── pip-own-requirements.txt │ │ ├── pip-own-requirements.txt-expected.dumps │ │ ├── pip-own-requirements.txt-expected.json │ │ ├── pip-upgrader-example.txt │ │ ├── pip-upgrader-example.txt-expected.dumps │ │ ├── pip-upgrader-example.txt-expected.json │ │ ├── pipfile-requirements-tests.txt │ │ ├── pipfile-requirements-tests.txt-expected.dumps │ │ ├── pipfile-requirements-tests.txt-expected.json │ │ ├── pypi-oldest-requirements-tests.txt │ │ ├── pypi-oldest-requirements-tests.txt-expected.dumps │ │ ├── pypi-oldest-requirements-tests.txt-expected.json │ │ ├── req-detector-requirements.txt │ │ ├── req-detector-requirements.txt-expected.dumps │ │ ├── req-detector-requirements.txt-expected.json │ │ ├── requirement-parser-issues.txt │ │ ├── requirement-parser-issues.txt-expected.dumps │ │ ├── requirement-parser-issues.txt-expected.json │ │ ├── requirementslib-tests.txt │ │ ├── requirementslib-tests.txt-expected.dumps │ │ ├── requirementslib-tests.txt-expected.json │ │ ├── serverless-python-requirements-tests.txt │ │ ├── serverless-python-requirements-tests.txt-expected.dumps │ │ ├── serverless-python-requirements-tests.txt-expected.json │ │ ├── sort-requirements-tests.txt │ │ ├── sort-requirements-tests.txt-expected.dumps │ │ ├── sort-requirements-tests.txt-expected.json │ │ ├── supported_options2.txt │ │ ├── supported_options2.txt-expected.dumps │ │ ├── supported_options2.txt-expected.json │ │ ├── unsupported_options.txt │ │ ├── unsupported_options.txt-expected.dumps │ │ └── unsupported_options.txt-expected.json │ └── sc-requirements │ │ ├── basic-requirements.txt │ │ ├── basic-requirements.txt-expected.dumps │ │ ├── basic-requirements.txt-expected.json │ │ ├── comments_and_empties-requirements.txt │ │ ├── comments_and_empties-requirements.txt-expected.dumps │ │ ├── comments_and_empties-requirements.txt-expected.json │ │ ├── complex-requirements.txt │ │ ├── complex-requirements.txt-expected.dumps │ │ ├── complex-requirements.txt-expected.json │ │ ├── dev-requirements-dev.txt │ │ ├── dev-requirements-dev.txt-expected.dumps │ │ ├── dev-requirements-dev.txt-expected.json │ │ ├── double_extras-requirements.txt │ │ ├── double_extras-requirements.txt-expected.dumps │ │ ├── double_extras-requirements.txt-expected.json │ │ ├── editable-requirements.txt │ │ ├── editable-requirements.txt-expected.dumps │ │ ├── editable-requirements.txt-expected.json │ │ ├── eol_comment-requirements.txt │ │ ├── eol_comment-requirements.txt-expected.dumps │ │ ├── eol_comment-requirements.txt-expected.json │ │ ├── invalid_spec-requirements.txt │ │ ├── invalid_spec-requirements.txt-expected.dumps │ │ ├── invalid_spec-requirements.txt-expected.json │ │ ├── local_paths_and_files-requirements.txt │ │ ├── local_paths_and_files-requirements.txt-expected.dumps │ │ ├── local_paths_and_files-requirements.txt-expected.json │ │ ├── many_specs-requirements.txt │ │ ├── many_specs-requirements.txt-expected.dumps │ │ ├── many_specs-requirements.txt-expected.json │ │ ├── mixed-requirements.txt │ │ ├── mixed-requirements.txt-expected.dumps │ │ ├── mixed-requirements.txt-expected.json │ │ ├── pinned-sample-requirements.txt │ │ ├── pinned-sample-requirements.txt-expected.dumps │ │ ├── pinned-sample-requirements.txt-expected.json │ │ ├── repeated-requirements.txt │ │ ├── repeated-requirements.txt-expected.dumps │ │ ├── repeated-requirements.txt-expected.json │ │ ├── simple-requirements.txt │ │ ├── simple-requirements.txt-expected.dumps │ │ ├── simple-requirements.txt-expected.json │ │ ├── urls_wth_checksums-requirements.txt │ │ ├── urls_wth_checksums-requirements.txt-expected.dumps │ │ ├── urls_wth_checksums-requirements.txt-expected.json │ │ ├── vcs-git-requirements.txt │ │ ├── vcs-git-requirements.txt-expected.dumps │ │ ├── vcs-git-requirements.txt-expected.json │ │ ├── vcs_editable-requirements.txt │ │ ├── vcs_editable-requirements.txt-expected.dumps │ │ ├── vcs_editable-requirements.txt-expected.json │ │ ├── vcs_eggs-requirements.txt │ │ ├── vcs_eggs-requirements.txt-expected.dumps │ │ ├── vcs_eggs-requirements.txt-expected.json │ │ ├── vcs_extras_require-requirements.txt │ │ ├── vcs_extras_require-requirements.txt-expected.dumps │ │ └── vcs_extras_require-requirements.txt-expected.json ├── lib │ ├── __init__.py │ └── path.py ├── test_requirements_file.py └── unit │ ├── __init__.py │ ├── compatibility_tags.py │ ├── misc.py │ ├── temp_dir.py │ ├── test_link.py │ ├── test_models_wheel.py │ ├── test_req.py │ ├── test_req_file.py │ ├── test_req_install.py │ ├── test_urls.py │ ├── test_utils.py │ ├── test_utils_compatibility_tags.py │ └── test_utils_temp_dir.py ├── requirements_detector ├── test1 │ └── requirements.txt ├── test2 │ └── requirements │ │ ├── base.txt │ │ └── webui.pip ├── test3 │ ├── pip_requirements.txt │ ├── reqs.txt │ ├── requirements_base.txt │ ├── requirements_test.txt │ └── test_requirements.txt └── test5 │ └── invalid_requirements.txt ├── requirements_parser_reqfiles ├── blank_1.txt ├── blank_1.txt-expected.json ├── comment_1.txt ├── comment_1.txt-expected.json ├── comment_2.txt ├── comment_2.txt-expected.json ├── crateio_requirements.txt ├── crateio_requirements.txt-expected.json ├── editable_1.txt ├── editable_1.txt-expected.json ├── editable_2.txt ├── editable_2.txt-expected.json ├── extras_1.txt ├── extras_1.txt-expected.json ├── fail_1.txt ├── fail_1.txt-expected.json ├── fail_2.txt ├── fail_2.txt-expected.json ├── file_1.txt ├── file_1.txt-expected.json ├── file_2.txt ├── file_2.txt-expected.json ├── illustrative_requirements.txt ├── illustrative_requirements.txt-expected.json ├── recursive_1.txt ├── recursive_1.txt-expected.json ├── recursive_2.txt ├── recursive_2.txt-expected.json ├── recursive_3.expected ├── recursive_3.txt-expected.json ├── rtfd_deploy_requirements.txt ├── rtfd_deploy_requirements.txt-expected.json ├── rtfd_requirements.txt ├── rtfd_requirements.txt-expected.json ├── simple_1.txt ├── simple_1.txt-expected.json ├── specs_1.txt ├── specs_1.txt-expected.json ├── subdirectory.txt ├── subdirectory.txt-expected.json ├── underscores.txt ├── underscores.txt-expected.json ├── uri.txt ├── uri.txt-expected.json ├── vcs_bzr.txt ├── vcs_bzr.txt-expected.json ├── vcs_git.txt ├── vcs_git.txt-expected.json ├── vcs_git_extras_require.txt ├── vcs_git_extras_require.txt-expected.json ├── vcs_hg.txt ├── vcs_hg.txt-expected.json ├── vcs_svn.txt └── vcs_svn.txt-expected.json ├── test_dparse.py ├── test_dparse.py.LICENSE ├── test_packaging_legacy_version.py ├── test_packaging_legacy_version.py.ABOUT ├── test_packaging_legacy_version.py.LICENSE ├── test_packaging_legacy_version.py.LICENSE.APACHE ├── test_packaging_legacy_version.py.LICENSE.BSD ├── test_pip_api_parse_requirements.py ├── test_pip_api_parse_requirements.py.LICENSE ├── test_requirements_detector_detection.py ├── test_requirements_detector_detection.py.LICENSE ├── test_requirements_detector_parsing.py ├── test_requirements_parser.py ├── test_requirements_parser.py.LICENSE └── test_skeleton_codestyle.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Ignore all Git auto CR/LF line endings conversions 2 | * -text 3 | pyproject.toml export-subst 4 | -------------------------------------------------------------------------------- /.github/workflows/docs-ci.yml: -------------------------------------------------------------------------------- 1 | name: CI Documentation 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-20.04 8 | 9 | strategy: 10 | max-parallel: 4 11 | matrix: 12 | python-version: [3.9] 13 | 14 | steps: 15 | - name: Checkout code 16 | uses: actions/checkout@v3 17 | 18 | - name: Set up Python ${{ matrix.python-version }} 19 | uses: actions/setup-python@v4 20 | with: 21 | python-version: ${{ matrix.python-version }} 22 | 23 | - name: Install Dependencies 24 | run: pip install -e .[docs] 25 | 26 | - name: Check Sphinx Documentation build minimally 27 | working-directory: ./docs 28 | run: sphinx-build -E -W source build 29 | 30 | - name: Check for documentation style errors 31 | working-directory: ./docs 32 | run: ./scripts/doc8_style_check.sh 33 | 34 | 35 | -------------------------------------------------------------------------------- /.github/workflows/pypi-release.yml: -------------------------------------------------------------------------------- 1 | name: Create library release archives, create a GH release and publish PyPI wheel and sdist on tag in main branch 2 | 3 | 4 | # This is executed automatically on a tag in the main branch 5 | 6 | # Summary of the steps: 7 | # - build wheels and sdist 8 | # - upload wheels and sdist to PyPI 9 | # - create gh-release and upload wheels and dists there 10 | # TODO: smoke test wheels and sdist 11 | # TODO: add changelog to release text body 12 | 13 | # WARNING: this is designed only for packages building as pure Python wheels 14 | 15 | on: 16 | workflow_dispatch: 17 | push: 18 | tags: 19 | - "v*.*.*" 20 | 21 | jobs: 22 | build-pypi-distribs: 23 | name: Build and publish library to PyPI 24 | runs-on: ubuntu-20.04 25 | 26 | steps: 27 | - uses: actions/checkout@v3 28 | - name: Set up Python 29 | uses: actions/setup-python@v4 30 | with: 31 | python-version: 3.9 32 | 33 | - name: Install pypa/build 34 | run: python -m pip install build --user 35 | 36 | - name: Build a binary wheel and a source tarball 37 | run: python -m build --sdist --wheel --outdir dist/ 38 | 39 | - name: Upload built archives 40 | uses: actions/upload-artifact@v3 41 | with: 42 | name: pypi_archives 43 | path: dist/* 44 | 45 | 46 | create-gh-release: 47 | name: Create GH release 48 | needs: 49 | - build-pypi-distribs 50 | runs-on: ubuntu-20.04 51 | 52 | steps: 53 | - name: Download built archives 54 | uses: actions/download-artifact@v3 55 | with: 56 | name: pypi_archives 57 | path: dist 58 | 59 | - name: Create GH release 60 | uses: softprops/action-gh-release@v1 61 | with: 62 | draft: true 63 | files: dist/* 64 | 65 | 66 | create-pypi-release: 67 | name: Create PyPI release 68 | needs: 69 | - create-gh-release 70 | runs-on: ubuntu-20.04 71 | 72 | steps: 73 | - name: Download built archives 74 | uses: actions/download-artifact@v3 75 | with: 76 | name: pypi_archives 77 | path: dist 78 | 79 | - name: Publish to PyPI 80 | if: startsWith(github.ref, 'refs/tags') 81 | uses: pypa/gh-action-pypi-publish@release/v1 82 | with: 83 | password: ${{ secrets.PYPI_API_TOKEN }} 84 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python compiled files 2 | *.py[cod] 3 | 4 | # virtualenv and other misc bits 5 | /src/*.egg-info 6 | *.egg-info 7 | /dist 8 | /build 9 | /bin 10 | /lib 11 | /scripts 12 | /Scripts 13 | /Lib 14 | /pip-selfcheck.json 15 | /tmp 16 | /venv 17 | .Python 18 | /include 19 | /Include 20 | /local 21 | */local/* 22 | /local/ 23 | /share/ 24 | /tcl/ 25 | /.eggs/ 26 | 27 | # Installer logs 28 | pip-log.txt 29 | 30 | # Unit test / coverage reports 31 | .cache 32 | .coverage 33 | .coverage.* 34 | nosetests.xml 35 | htmlcov 36 | 37 | # Translations 38 | *.mo 39 | 40 | # IDEs 41 | .project 42 | .pydevproject 43 | .idea 44 | org.eclipse.core.resources.prefs 45 | .vscode 46 | .vs 47 | 48 | # Sphinx 49 | docs/_build 50 | docs/bin 51 | docs/build 52 | docs/include 53 | docs/Lib 54 | doc/pyvenv.cfg 55 | pyvenv.cfg 56 | 57 | # Various junk and temp files 58 | .DS_Store 59 | *~ 60 | .*.sw[po] 61 | .build 62 | .ve 63 | *.bak 64 | /.cache/ 65 | 66 | # pyenv 67 | /.python-version 68 | /man/ 69 | /.pytest_cache/ 70 | lib64 71 | tcl 72 | 73 | # Ignore Jupyter Notebook related temp files 74 | .ipynb_checkpoints/ 75 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # .readthedocs.yml 2 | # Read the Docs configuration file 3 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 4 | 5 | # Required 6 | version: 2 7 | 8 | # Build in latest ubuntu/python 9 | build: 10 | os: ubuntu-22.04 11 | tools: 12 | python: "3.11" 13 | 14 | # Build PDF & ePub 15 | formats: 16 | - epub 17 | - pdf 18 | 19 | # Where the Sphinx conf.py file is located 20 | sphinx: 21 | configuration: docs/source/conf.py 22 | 23 | # Setting the python version and doc build requirements 24 | python: 25 | install: 26 | - method: pip 27 | path: . 28 | extra_requirements: 29 | - docs 30 | -------------------------------------------------------------------------------- /AUTHORS.rst: -------------------------------------------------------------------------------- 1 | The following organizations or individuals have contributed to this repo: 2 | 3 | - 4 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | Changelog 2 | ========= 3 | 4 | 5 | v32.0.2 6 | ------- 7 | Ensure all tests pass correctly. 8 | Adopt latest skeleton. 9 | 10 | 11 | 12 | v32.0.1 13 | ------- 14 | 15 | Ensure all tests pass correctly. 16 | Adopt latest skeleton. 17 | 18 | Add new RequirementsFile.from_string() convenience factory method 19 | 20 | Vendor LegacyVersion from pre V2 packaging. Otherwise packaging v2 broke 21 | this library and its dependencies. 22 | 23 | 24 | v32.0.0 25 | ------- 26 | 27 | Emergency pin of packaging to version under 22. 28 | This breaks this library and its dependents otherwise 29 | 30 | 31 | 32 | v31.1.1 33 | ------- 34 | 35 | Add new tests. No other changes. 36 | 37 | 38 | v31.1.0 39 | ------- 40 | 41 | Add new convenience method InstallRequirement.get_pinned_version() to return 42 | the pinned version if there is such thing. 43 | 44 | 45 | v31.0.1 46 | ------- 47 | 48 | Fix twine warning wrt. long_description content type. 49 | 50 | 51 | v31.0.0 52 | ------- 53 | 54 | Include code in wheel. This was not included otherwise. 55 | Improve documentation 56 | 57 | 58 | v30.0.0 59 | ------- 60 | 61 | Initial release based on pip at commit 5cf98408f48a0ef91d61aea56485a7a83f6bbfa8 62 | e.g., https://github.com/pypa/pip/tree/5cf98408f48a0ef91d61aea56485a7a83f6bbfa8 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) The pip developers (see AUTHORS.rst file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | graft src 2 | 3 | include *.LICENSE 4 | include NOTICE 5 | include *.ABOUT 6 | include *.toml 7 | include *.yml 8 | include *.rst 9 | include setup.* 10 | include configure* 11 | include requirements* 12 | include .git* 13 | 14 | global-exclude *.py[co] __pycache__ *.*~ 15 | 16 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # SPDX-License-Identifier: Apache-2.0 2 | # 3 | # Copyright (c) nexB Inc. and others. All rights reserved. 4 | # ScanCode is a trademark of nexB Inc. 5 | # SPDX-License-Identifier: Apache-2.0 6 | # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. 7 | # See https://github.com/aboutcode-org/skeleton for support or download. 8 | # See https://aboutcode.org for more information about nexB OSS projects. 9 | # 10 | 11 | # Python version can be specified with `$ PYTHON_EXE=python3.x make conf` 12 | PYTHON_EXE?=python3 13 | VENV=venv 14 | ACTIVATE?=. ${VENV}/bin/activate; 15 | 16 | dev: 17 | @echo "-> Configure the development envt." 18 | ./configure --dev 19 | 20 | isort: 21 | @echo "-> Apply isort changes to ensure proper imports ordering" 22 | ${VENV}/bin/isort --sl -l 100 src tests setup.py 23 | 24 | black: 25 | @echo "-> Apply black code formatter" 26 | ${VENV}/bin/black -l 100 src tests setup.py 27 | 28 | doc8: 29 | @echo "-> Run doc8 validation" 30 | @${ACTIVATE} doc8 --max-line-length 100 --ignore-path docs/_build/ --quiet docs/ 31 | 32 | valid: isort black 33 | 34 | check: 35 | @echo "-> Run pycodestyle (PEP8) validation" 36 | @${ACTIVATE} pycodestyle --max-line-length=100 --exclude=.eggs,venv,lib,thirdparty,docs,migrations,settings.py,.cache . 37 | @echo "-> Run isort imports ordering validation" 38 | @${ACTIVATE} isort --sl --check-only -l 100 setup.py src tests . 39 | @echo "-> Run black validation" 40 | @${ACTIVATE} black --check --check -l 100 src tests setup.py 41 | 42 | clean: 43 | @echo "-> Clean the Python env" 44 | ./configure --clean 45 | 46 | test: 47 | @echo "-> Run the test suite" 48 | ${VENV}/bin/pytest -vvs 49 | 50 | docs: 51 | rm -rf docs/_build/ 52 | @${ACTIVATE} sphinx-build docs/ docs/_build/ 53 | 54 | .PHONY: conf dev check valid black isort clean test docs 55 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # We use Azure to run the full tests suites on multiple Python 3.x 3 | # on multiple Windows, macOS and Linux versions all on 64 bits 4 | # These jobs are using VMs with Azure-provided Python builds 5 | ################################################################################ 6 | 7 | jobs: 8 | - template: etc/ci/azure-posix.yml 9 | parameters: 10 | job_name: ubuntu20_cpython 11 | image_name: ubuntu-20.04 12 | python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11'] 13 | test_suites: 14 | all: venv/bin/pytest -n 2 -vvs 15 | 16 | - template: etc/ci/azure-posix.yml 17 | parameters: 18 | job_name: ubuntu22_cpython 19 | image_name: ubuntu-22.04 20 | python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11'] 21 | test_suites: 22 | all: venv/bin/pytest -n 2 -vvs 23 | 24 | - template: etc/ci/azure-posix.yml 25 | parameters: 26 | job_name: macos12_cpython 27 | image_name: macOS-12 28 | python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11'] 29 | test_suites: 30 | all: venv/bin/pytest -n 2 -vvs 31 | 32 | - template: etc/ci/azure-posix.yml 33 | parameters: 34 | job_name: macos13_cpython 35 | image_name: macOS-13 36 | python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11'] 37 | test_suites: 38 | all: venv/bin/pytest -n 2 -vvs 39 | 40 | - template: etc/ci/azure-win.yml 41 | parameters: 42 | job_name: win2019_cpython 43 | image_name: windows-2019 44 | python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11'] 45 | test_suites: 46 | all: venv\Scripts\pytest -n 2 -vvs 47 | 48 | - template: etc/ci/azure-win.yml 49 | parameters: 50 | job_name: win2022_cpython 51 | image_name: windows-2022 52 | python_versions: ['3.7', '3.8', '3.9', '3.10', '3.11'] 53 | test_suites: 54 | all: venv\Scripts\pytest -n 2 -vvs 55 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SPHINXAUTOBUILD = sphinx-autobuild 9 | SOURCEDIR = source 10 | BUILDDIR = build 11 | 12 | # Put it first so that "make" without argument is like "make help". 13 | help: 14 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 15 | 16 | .PHONY: help Makefile 17 | 18 | # Run the development server using sphinx-autobuild 19 | docs: 20 | @echo 21 | @echo "Starting up the docs server..." 22 | @echo 23 | $(SPHINXAUTOBUILD) --port 8000 --watch ${SOURCEDIR} $(SOURCEDIR) "$(BUILDDIR)/html" $(SPHINXOPTS) $(O) 24 | 25 | # Catch-all target: route all unknown targets to Sphinx using the new 26 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 27 | %: Makefile 28 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 29 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | if "%SPHINXAUTOBUILD%" == "" ( 11 | set SPHINXAUTOBUILD=sphinx-autobuild 12 | ) 13 | set SOURCEDIR=source 14 | set BUILDDIR=build 15 | 16 | if "%1" == "" goto help 17 | 18 | if "%1" == "docs" goto docs 19 | 20 | %SPHINXBUILD% >NUL 2>NUL 21 | if errorlevel 9009 ( 22 | echo. 23 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 24 | echo.installed, then set the SPHINXBUILD environment variable to point 25 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 26 | echo.may add the Sphinx directory to PATH. 27 | echo. 28 | echo.If you don't have Sphinx installed, grab it from 29 | echo.http://sphinx-doc.org/ 30 | exit /b 1 31 | ) 32 | 33 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 34 | goto end 35 | 36 | :docs 37 | @echo 38 | @echo Starting up the docs server... 39 | @echo 40 | %SPHINXAUTOBUILD% --port 8000 --watch %SOURCEDIR% %SOURCEDIR% %BUILDDIR%\html %SPHINXOPTS% %O% 41 | goto end 42 | 43 | :help 44 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 45 | 46 | :end 47 | popd 48 | -------------------------------------------------------------------------------- /docs/scripts/doc8_style_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # halt script on error 3 | set -e 4 | # Check for Style Code Violations 5 | doc8 --max-line-length 100 source --ignore D000 --quiet -------------------------------------------------------------------------------- /docs/scripts/sphinx_build_link_check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # halt script on error 3 | set -e 4 | # Build locally, and then check links 5 | sphinx-build -E -W -b linkcheck source build -------------------------------------------------------------------------------- /docs/source/index.rst: -------------------------------------------------------------------------------- 1 | Welcome to nexb-skeleton's documentation! 2 | ========================================= 3 | 4 | .. toctree:: 5 | :maxdepth: 2 6 | :caption: Contents: 7 | 8 | skeleton-usage 9 | contribute/contrib_doc 10 | 11 | Indices and tables 12 | ================== 13 | 14 | * :ref:`genindex` 15 | * :ref:`modindex` 16 | * :ref:`search` 17 | -------------------------------------------------------------------------------- /etc/README.rst: -------------------------------------------------------------------------------- 1 | To keep the git history, we used these: 2 | 3 | 1. Use git-filter-repo from https://github.com/newren/git-filter-repo/ 4 | And this script git-filter-repo-pip.sh 5 | 6 | 2. Then use git-rename-merge.sh to combine files in sequence 7 | 8 | There have been other manual intermediate commits to remove unused code 9 | 10 | Finally the code was adjusted and cleaned by hand. 11 | -------------------------------------------------------------------------------- /etc/ci/azure-container-deb.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | job_name: '' 3 | container: '' 4 | python_path: '' 5 | python_version: '' 6 | package_manager: apt-get 7 | install_python: '' 8 | install_packages: | 9 | set -e -x 10 | sudo apt-get -y update 11 | sudo apt-get -y install \ 12 | build-essential \ 13 | xz-utils zlib1g bzip2 libbz2-1.0 tar \ 14 | sqlite3 libxml2-dev libxslt1-dev \ 15 | software-properties-common openssl 16 | test_suite: '' 17 | test_suite_label: '' 18 | 19 | 20 | jobs: 21 | - job: ${{ parameters.job_name }} 22 | 23 | pool: 24 | vmImage: 'ubuntu-16.04' 25 | 26 | container: 27 | image: ${{ parameters.container }} 28 | options: '--name ${{ parameters.job_name }} -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -v /usr/bin/docker:/tmp/docker:ro' 29 | 30 | steps: 31 | - checkout: self 32 | fetchDepth: 10 33 | 34 | - script: /tmp/docker exec -t -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -u 0 ${{ parameters.job_name }} $(Build.SourcesDirectory)/etc/ci/install_sudo.sh ${{ parameters.package_manager }} 35 | displayName: Install sudo 36 | 37 | - script: ${{ parameters.install_packages }} 38 | displayName: Install required packages 39 | 40 | - script: ${{ parameters.install_python }} 41 | displayName: 'Install Python ${{ parameters.python_version }}' 42 | 43 | - script: ${{ parameters.python_path }} --version 44 | displayName: 'Show Python version' 45 | 46 | - script: PYTHON_EXE=${{ parameters.python_path }} ./configure --dev 47 | displayName: 'Run Configure' 48 | 49 | - script: ${{ parameters.test_suite }} 50 | displayName: 'Run ${{ parameters.test_suite_label }} tests with py${{ parameters.python_version }} on ${{ parameters.job_name }}' 51 | -------------------------------------------------------------------------------- /etc/ci/azure-container-rpm.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | job_name: '' 3 | image_name: 'ubuntu-16.04' 4 | container: '' 5 | python_path: '' 6 | python_version: '' 7 | package_manager: yum 8 | install_python: '' 9 | install_packages: | 10 | set -e -x 11 | sudo yum groupinstall -y "Development Tools" 12 | sudo yum install -y \ 13 | openssl openssl-devel \ 14 | sqlite-devel zlib-devel xz-devel bzip2-devel \ 15 | bzip2 tar unzip zip \ 16 | libxml2-devel libxslt-devel 17 | test_suite: '' 18 | test_suite_label: '' 19 | 20 | 21 | jobs: 22 | - job: ${{ parameters.job_name }} 23 | 24 | pool: 25 | vmImage: ${{ parameters.image_name }} 26 | 27 | container: 28 | image: ${{ parameters.container }} 29 | options: '--name ${{ parameters.job_name }} -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -v /usr/bin/docker:/tmp/docker:ro' 30 | 31 | steps: 32 | - checkout: self 33 | fetchDepth: 10 34 | 35 | - script: /tmp/docker exec -t -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -u 0 ${{ parameters.job_name }} $(Build.SourcesDirectory)/etc/ci/install_sudo.sh ${{ parameters.package_manager }} 36 | displayName: Install sudo 37 | 38 | - script: ${{ parameters.install_packages }} 39 | displayName: Install required packages 40 | 41 | - script: ${{ parameters.install_python }} 42 | displayName: 'Install Python ${{ parameters.python_version }}' 43 | 44 | - script: ${{ parameters.python_path }} --version 45 | displayName: 'Show Python version' 46 | 47 | - script: PYTHON_EXE=${{ parameters.python_path }} ./configure --dev 48 | displayName: 'Run Configure' 49 | 50 | - script: ${{ parameters.test_suite }} 51 | displayName: 'Run ${{ parameters.test_suite_label }} tests with py${{ parameters.python_version }} on ${{ parameters.job_name }}' 52 | -------------------------------------------------------------------------------- /etc/ci/azure-posix.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | job_name: '' 3 | image_name: '' 4 | python_versions: [] 5 | test_suites: {} 6 | python_architecture: x64 7 | 8 | jobs: 9 | - job: ${{ parameters.job_name }} 10 | 11 | pool: 12 | vmImage: ${{ parameters.image_name }} 13 | 14 | strategy: 15 | matrix: 16 | ${{ each tsuite in parameters.test_suites }}: 17 | ${{ tsuite.key }}: 18 | test_suite_label: ${{ tsuite.key }} 19 | test_suite: ${{ tsuite.value }} 20 | 21 | steps: 22 | - checkout: self 23 | fetchDepth: 10 24 | 25 | - ${{ each pyver in parameters.python_versions }}: 26 | - task: UsePythonVersion@0 27 | inputs: 28 | versionSpec: '${{ pyver }}' 29 | architecture: '${{ parameters.python_architecture }}' 30 | displayName: '${{ pyver }} - Install Python' 31 | 32 | - script: | 33 | python${{ pyver }} --version 34 | echo "python${{ pyver }}" > PYTHON_EXECUTABLE 35 | ./configure --clean && ./configure --dev 36 | displayName: '${{ pyver }} - Configure' 37 | 38 | - script: $(test_suite) 39 | displayName: '${{ pyver }} - $(test_suite_label) on ${{ parameters.job_name }}' 40 | -------------------------------------------------------------------------------- /etc/ci/azure-win.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | job_name: '' 3 | image_name: '' 4 | python_versions: [] 5 | test_suites: {} 6 | python_architecture: x64 7 | 8 | jobs: 9 | - job: ${{ parameters.job_name }} 10 | 11 | pool: 12 | vmImage: ${{ parameters.image_name }} 13 | 14 | strategy: 15 | matrix: 16 | ${{ each tsuite in parameters.test_suites }}: 17 | ${{ tsuite.key }}: 18 | test_suite_label: ${{ tsuite.key }} 19 | test_suite: ${{ tsuite.value }} 20 | 21 | steps: 22 | - checkout: self 23 | fetchDepth: 10 24 | 25 | - ${{ each pyver in parameters.python_versions }}: 26 | - task: UsePythonVersion@0 27 | inputs: 28 | versionSpec: '${{ pyver }}' 29 | architecture: '${{ parameters.python_architecture }}' 30 | displayName: '${{ pyver }} - Install Python' 31 | 32 | - script: | 33 | python --version 34 | echo | set /p=python> PYTHON_EXECUTABLE 35 | configure --clean && configure --dev 36 | displayName: '${{ pyver }} - Configure' 37 | 38 | - script: $(test_suite) 39 | displayName: '${{ pyver }} - $(test_suite_label) on ${{ parameters.job_name }}' 40 | -------------------------------------------------------------------------------- /etc/ci/install_sudo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | 5 | if [[ "$1" == "apt-get" ]]; then 6 | apt-get update -y 7 | apt-get -o DPkg::Options::="--force-confold" install -y sudo 8 | 9 | elif [[ "$1" == "yum" ]]; then 10 | yum install -y sudo 11 | 12 | elif [[ "$1" == "dnf" ]]; then 13 | dnf install -y sudo 14 | 15 | fi 16 | -------------------------------------------------------------------------------- /etc/ci/macports-ci.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: macports-ci 2 | name: macports-ci 3 | version: c9676e67351a3a519e37437e196cd0ee9c2180b8 4 | download_url: https://raw.githubusercontent.com/GiovanniBussi/macports-ci/c9676e67351a3a519e37437e196cd0ee9c2180b8/macports-ci 5 | description: Simplify MacPorts setup on Travis-CI 6 | homepage_url: https://github.com/GiovanniBussi/macports-ci 7 | license_expression: mit 8 | copyright: Copyright (c) Giovanni Bussi 9 | attribute: yes 10 | checksum_md5: 5d31d479132502f80acdaed78bed9e23 11 | checksum_sha1: 74b15643bd1a528d91b4a7c2169c6fc656f549c2 12 | package_url: pkg:github/giovannibussi/macports-ci@c9676e67351a3a519e37437e196cd0ee9c2180b8#macports-ci 13 | licenses: 14 | - key: mit 15 | name: MIT License 16 | file: mit.LICENSE 17 | -------------------------------------------------------------------------------- /etc/ci/mit.LICENSE: -------------------------------------------------------------------------------- 1 | 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: 2 | 3 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 4 | 5 | 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. -------------------------------------------------------------------------------- /etc/git-filter-repo-pip.sh: -------------------------------------------------------------------------------- 1 | # use gitfilter-repo to filter pip upstream history to keep the set of files we 2 | # use 3 | gfr --path README.rst \ 4 | --path LICENSE.txt \ 5 | --path AUTHORS.txt \ 6 | --path tests/__init__.py \ 7 | --path tests/lib/path.py \ 8 | --path tests/lib/__init__.py \ 9 | --path tests/unit/test_link.py \ 10 | --path tests/unit/__init__.py \ 11 | --path tests/unit/test_urls.py \ 12 | --path tests/unit/test_models_wheel.py \ 13 | --path tests/unit/test_req_install.py \ 14 | --path tests/unit/test_req_file.py \ 15 | --path tests/unit/test_utils.py \ 16 | --path tests/unit/test_utils_temp_dir.py \ 17 | --path tests/unit/test_utils_compatibility_tags.py \ 18 | --path tests/unit/test_req.py \ 19 | --path tests/data/reqfiles/supported_options2.txt \ 20 | --path tests/data/reqfiles/README.txt \ 21 | --path tests/requirements.txt \ 22 | --path tests/conftest.py \ 23 | --path src/pip/_internal/__init__.py \ 24 | --path src/pip/_internal/req/__init__.py \ 25 | --path src/pip/_internal/req/req_file.py \ 26 | --path src/pip/_internal/utils/compatibility_tags.py \ 27 | --path src/pip/_internal/utils/temp_dir.py \ 28 | --path src/pip/_internal/utils/misc.py \ 29 | --path src/pip/_internal/utils/encoding.py \ 30 | --path src/pip/_internal/models/index.py \ 31 | --path src/pip/_internal/exceptions.py \ 32 | --path src/pip/_internal/models/format_control.py \ 33 | --path src/pip/_internal/models/search_scope.py \ 34 | --path src/pip/_internal/index/package_finder.py \ 35 | --path src/pip/_internal/cli/cmdoptions.py \ 36 | --path src/pip/_internal/req/req_file.py \ 37 | --path src/pip/_internal/utils/urls.py \ 38 | --path src/pip/_internal/utils/hashes.py \ 39 | --path src/pip/_internal/utils/models.py \ 40 | --path src/pip/_internal/utils/packaging.py \ 41 | --path src/pip/_internal/models/link.py \ 42 | --path src/pip/_vendor/pkg_resource/__init__.py \ 43 | --path src/pip/_vendor/pkg_resource/__init__.py \ 44 | --path src/pip/_internal/req/req_install.py \ 45 | --path src/pip/_internal/vcs/versioncontrol.py \ 46 | --path src/pip/_internal/utils/misc.py \ 47 | --path src/pip/_internal/utils/filetypes.py \ 48 | --path src/pip/_internal/req/constructors.py \ 49 | --path src/pip/_internal/models/wheel.py \ 50 | --force --dry-run 51 | -------------------------------------------------------------------------------- /etc/git-rename-merge.sh: -------------------------------------------------------------------------------- 1 | 2 | ############ 3 | # Git-combine SOURCE1 followed by SOURCE2 in new renamed TARGET file 4 | # preserving the detailed history and line-level blame. 5 | 6 | # ./ren.sh src/pip/_internal/utils/encoding.py src/pip/_internal/models/index.py src/pip1.py 7 | # ./ren.sh src/pip1.py src/pip/_internal/exceptions.py src/pip2.py 8 | # ./ren.sh src/pip2.py src/pip/_internal/models/format_control.py src/pip3.py 9 | # ./ren.sh src/pip3.py src/pip/_internal/models/search_scope.py src/pip4.py 10 | # ./ren.sh src/pip4.py src/pip/_internal/cli/cmdoptions.py src/pip5.py 11 | # ./ren.sh src/pip5.py src/pip/_internal/index/package_finder.py src/pip6.py 12 | # ./ren.sh src/pip6.py src/pip/_internal/req/req_file.py src/pip7.py 13 | # ./ren.sh src/pip7.py src/pip/_internal/utils/urls.py src/pip8.py 14 | # ./ren.sh src/pip8.py src/pip/_internal/utils/hashes.py src/pip9.py 15 | # ./ren.sh src/pip9.py src/pip/_internal/utils/models.py src/pip10.py 16 | # ./ren.sh src/pip10.py src/pip/_internal/utils/packaging.py src/pip11.py 17 | # ./ren.sh src/pip11.py src/pip/_internal/models/link.py src/pip12.py 18 | # ./ren.sh src/pip12.py src/pip/_internal/req/req_install.py src/pip13.py 19 | # ./ren.sh src/pip13.py src/pip/_internal/vcs/versioncontrol.py src/pip14.py 20 | # ./ren.sh src/pip14.py src/pip/_internal/utils/misc.py src/pip15.py 21 | # ./ren.sh src/pip15.py src/pip/_internal/utils/filetypes.py src/pip16.py 22 | # ./ren.sh src/pip16.py src/pip/_internal/req/constructors.py src/pip17.py 23 | # ./ren.sh src/pip17.py src/pip/_internal/models/wheel.py src/pip_requirements.py 24 | # 25 | 26 | SOURCE1=$1 27 | SOURCE2=$2 28 | TARGET=$3 29 | 30 | # start a new branch 31 | git branch -D renamings 32 | git checkout -b renamings 33 | 34 | git mv $SOURCE2 $TARGET 35 | git commit -m "Rename second python script 36 | 37 | Rename $SOURCE2 to $TARGET 38 | 39 | Signed-off-by: Philippe Ombredanne " 40 | 41 | git checkout - 42 | 43 | git mv $SOURCE1 $TARGET 44 | git commit -m "Rename first python script 45 | 46 | Rename $SOURCE1 to $TARGET 47 | 48 | Signed-off-by: Philippe Ombredanne " 49 | 50 | git merge -m "Combine two python files in one 51 | 52 | Append $SOURCE2 53 | to $SOURCE1 54 | keeping detailed history. 55 | 56 | Signed-off-by: Philippe Ombredanne " renamings 57 | 58 | git cat-file --filters HEAD:$TARGET > $TARGET 59 | git cat-file --filters renamings:$TARGET >> $TARGET 60 | git add $TARGET 61 | git merge --continue 62 | 63 | -------------------------------------------------------------------------------- /etc/scripts/check_thirdparty.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) nexB Inc. and others. All rights reserved. 5 | # ScanCode is a trademark of nexB Inc. 6 | # SPDX-License-Identifier: Apache-2.0 7 | # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. 8 | # See https://github.com/aboutcode-org/skeleton for support or download. 9 | # See https://aboutcode.org for more information about nexB OSS projects. 10 | # 11 | import click 12 | 13 | import utils_thirdparty 14 | 15 | 16 | @click.command() 17 | @click.option( 18 | "-d", 19 | "--dest", 20 | type=click.Path(exists=True, readable=True, 21 | path_type=str, file_okay=False), 22 | required=True, 23 | help="Path to the thirdparty directory to check.", 24 | ) 25 | @click.option( 26 | "-w", 27 | "--wheels", 28 | is_flag=True, 29 | help="Check missing wheels.", 30 | ) 31 | @click.option( 32 | "-s", 33 | "--sdists", 34 | is_flag=True, 35 | help="Check missing source sdists tarballs.", 36 | ) 37 | @click.help_option("-h", "--help") 38 | def check_thirdparty_dir( 39 | dest, 40 | wheels, 41 | sdists, 42 | ): 43 | """ 44 | Check a thirdparty directory for problems and print these on screen. 45 | """ 46 | # check for problems 47 | print(f"==> CHECK FOR PROBLEMS") 48 | utils_thirdparty.find_problems( 49 | dest_dir=dest, 50 | report_missing_sources=sdists, 51 | report_missing_wheels=wheels, 52 | ) 53 | 54 | 55 | if __name__ == "__main__": 56 | check_thirdparty_dir() 57 | -------------------------------------------------------------------------------- /etc/scripts/gen_pypi_simple.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: gen_pypi_simple.py 2 | name: gen_pypi_simple.py 3 | license_expression: bsd-2-clause-views and mit 4 | copyright: Copyright (c) nexB Inc. 5 | Copyright (c) 2010 David Wolever 6 | Copyright (c) The pip developers 7 | notes: Originally from https://github.com/wolever/pip2pi and modified extensivley 8 | Also partially derived from pip code 9 | -------------------------------------------------------------------------------- /etc/scripts/gen_requirements.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) nexB Inc. and others. All rights reserved. 5 | # ScanCode is a trademark of nexB Inc. 6 | # SPDX-License-Identifier: Apache-2.0 7 | # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. 8 | # See https://github.com/aboutcode-org/skeleton for support or download. 9 | # See https://aboutcode.org for more information about nexB OSS projects. 10 | # 11 | import argparse 12 | import pathlib 13 | 14 | import utils_requirements 15 | 16 | """ 17 | Utilities to manage requirements files. 18 | NOTE: this should use ONLY the standard library and not import anything else 19 | because this is used for boostrapping with no requirements installed. 20 | """ 21 | 22 | 23 | def gen_requirements(): 24 | description = """ 25 | Create or replace the `--requirements-file` file FILE requirements file with all 26 | locally installed Python packages.all Python packages found installed in `--site-packages-dir` 27 | """ 28 | parser = argparse.ArgumentParser(description=description) 29 | 30 | parser.add_argument( 31 | "-s", 32 | "--site-packages-dir", 33 | dest="site_packages_dir", 34 | type=pathlib.Path, 35 | required=True, 36 | metavar="DIR", 37 | help="Path to the 'site-packages' directory where wheels are installed such as lib/python3.6/site-packages", 38 | ) 39 | parser.add_argument( 40 | "-r", 41 | "--requirements-file", 42 | type=pathlib.Path, 43 | metavar="FILE", 44 | default="requirements.txt", 45 | help="Path to the requirements file to update or create.", 46 | ) 47 | 48 | args = parser.parse_args() 49 | 50 | utils_requirements.lock_requirements( 51 | site_packages_dir=args.site_packages_dir, 52 | requirements_file=args.requirements_file, 53 | ) 54 | 55 | 56 | if __name__ == "__main__": 57 | gen_requirements() 58 | -------------------------------------------------------------------------------- /etc/scripts/gen_requirements_dev.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) nexB Inc. and others. All rights reserved. 5 | # ScanCode is a trademark of nexB Inc. 6 | # SPDX-License-Identifier: Apache-2.0 7 | # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. 8 | # See https://github.com/aboutcode-org/skeleton for support or download. 9 | # See https://aboutcode.org for more information about nexB OSS projects. 10 | # 11 | import argparse 12 | import pathlib 13 | 14 | import utils_requirements 15 | 16 | """ 17 | Utilities to manage requirements files. 18 | NOTE: this should use ONLY the standard library and not import anything else 19 | because this is used for boostrapping with no requirements installed. 20 | """ 21 | 22 | 23 | def gen_dev_requirements(): 24 | description = """ 25 | Create or overwrite the `--dev-requirements-file` pip requirements FILE with 26 | all Python packages found installed in `--site-packages-dir`. Exclude 27 | package names also listed in the --main-requirements-file pip requirements 28 | FILE (that are assume to the production requirements and therefore to always 29 | be present in addition to the development requirements). 30 | """ 31 | parser = argparse.ArgumentParser(description=description) 32 | 33 | parser.add_argument( 34 | "-s", 35 | "--site-packages-dir", 36 | type=pathlib.Path, 37 | required=True, 38 | metavar="DIR", 39 | help='Path to the "site-packages" directory where wheels are installed such as lib/python3.6/site-packages', 40 | ) 41 | parser.add_argument( 42 | "-d", 43 | "--dev-requirements-file", 44 | type=pathlib.Path, 45 | metavar="FILE", 46 | default="requirements-dev.txt", 47 | help="Path to the dev requirements file to update or create.", 48 | ) 49 | parser.add_argument( 50 | "-r", 51 | "--main-requirements-file", 52 | type=pathlib.Path, 53 | default="requirements.txt", 54 | metavar="FILE", 55 | help="Path to the main requirements file. Its requirements will be excluded " 56 | "from the generated dev requirements.", 57 | ) 58 | args = parser.parse_args() 59 | 60 | utils_requirements.lock_dev_requirements( 61 | dev_requirements_file=args.dev_requirements_file, 62 | main_requirements_file=args.main_requirements_file, 63 | site_packages_dir=args.site_packages_dir, 64 | ) 65 | 66 | 67 | if __name__ == "__main__": 68 | gen_dev_requirements() 69 | -------------------------------------------------------------------------------- /etc/scripts/requirements.txt: -------------------------------------------------------------------------------- 1 | aboutcode_toolkit 2 | attrs 3 | commoncode 4 | click 5 | requests 6 | saneyaml 7 | pip 8 | setuptools 9 | twine 10 | wheel 11 | build 12 | packvers 13 | -------------------------------------------------------------------------------- /etc/scripts/test_utils_pip_compatibility_tags.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: test_utils_pip_compatibility_tags.py 2 | 3 | type: github 4 | namespace: pypa 5 | name: pip 6 | version: 20.3.1 7 | subpath: tests/unit/test_utils_compatibility_tags.py 8 | 9 | package_url: pkg:github/pypa/pip@20.3.1#tests/unit/test_utils_compatibility_tags.py 10 | 11 | download_url: https://raw.githubusercontent.com/pypa/pip/20.3.1/tests/unit/test_utils_compatibility_tags.py 12 | copyright: Copyright (c) 2008-2020 The pip developers (see AUTHORS.txt file) 13 | license_expression: mit 14 | notes: subset copied from pip for tag handling 15 | -------------------------------------------------------------------------------- /etc/scripts/test_utils_pypi_supported_tags.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: test_utils_pypi_supported_tags.py 2 | 3 | type: github 4 | namespace: pypa 5 | name: warehouse 6 | version: 37a83dd342d9e3b3ab4f6bde47ca30e6883e2c4d 7 | subpath: tests/unit/forklift/test_legacy.py 8 | 9 | package_url: pkg:github/pypa/warehouse@37a83dd342d9e3b3ab4f6bde47ca30e6883e2c4d#tests/unit/forklift/test_legacy.py 10 | 11 | download_url: https://github.com/pypa/warehouse/blob/37a83dd342d9e3b3ab4f6bde47ca30e6883e2c4d/tests/unit/forklift/test_legacy.py 12 | copyright: Copyright (c) The warehouse developers 13 | homepage_url: https://warehouse.readthedocs.io 14 | license_expression: apache-2.0 15 | notes: Test for wheel platform checking copied and heavily modified on 16 | 2020-12-24 from warehouse. This contains the basic functions to check if a 17 | wheel file name is would be supported for uploading to PyPI. 18 | -------------------------------------------------------------------------------- /etc/scripts/utils_pip_compatibility_tags.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: utils_pip_compatibility_tags.py 2 | 3 | type: github 4 | namespace: pypa 5 | name: pip 6 | version: 20.3.1 7 | subpath: src/pip/_internal/utils/compatibility_tags.py 8 | 9 | package_url: pkg:github/pypa/pip@20.3.1#src/pip/_internal/utils/compatibility_tags.py 10 | 11 | download_url: https://github.com/pypa/pip/blob/20.3.1/src/pip/_internal/utils/compatibility_tags.py 12 | copyright: Copyright (c) 2008-2020 The pip developers (see AUTHORS.txt file) 13 | license_expression: mit 14 | notes: subset copied from pip for tag handling -------------------------------------------------------------------------------- /etc/scripts/utils_pypi_supported_tags.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: utils_pypi_supported_tags.py 2 | 3 | type: github 4 | namespace: pypa 5 | name: warehouse 6 | version: 37a83dd342d9e3b3ab4f6bde47ca30e6883e2c4d 7 | subpath: warehouse/forklift/legacy.py 8 | 9 | package_url: pkg:github/pypa/warehouse@37a83dd342d9e3b3ab4f6bde47ca30e6883e2c4d#warehouse/forklift/legacy.py 10 | 11 | download_url: https://github.com/pypa/warehouse/blob/37a83dd342d9e3b3ab4f6bde47ca30e6883e2c4d/warehouse/forklift/legacy.py 12 | copyright: Copyright (c) The warehouse developers 13 | homepage_url: https://warehouse.readthedocs.io 14 | license_expression: apache-2.0 15 | notes: Wheel platform checking copied and heavily modified on 2020-12-24 from 16 | warehouse. This contains the basic functions to check if a wheel file name is 17 | would be supported for uploading to PyPI. 18 | -------------------------------------------------------------------------------- /etc/scripts/utils_thirdparty.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: utils_thirdparty.py 2 | package_url: pkg:github.com/pypa/pip/@20.3.1#src/pip/_internal/models/wheel.py 3 | type: github 4 | namespace: pypa 5 | name: pip 6 | version: 20.3.1 7 | subpath: src/pip/_internal/models/wheel.py 8 | 9 | download_url: https://github.com/pypa/pip/blob/20.3.1/src/pip/_internal/models/wheel.py 10 | copyright: Copyright (c) 2008-2020 The pip developers (see AUTHORS.txt file) 11 | license_expression: mit 12 | notes: copied from pip-20.3.1 pip/_internal/models/wheel.py 13 | The models code has been heavily inspired from the ISC-licensed packaging-dists 14 | https://github.com/uranusjr/packaging-dists by Tzu-ping Chung 15 | -------------------------------------------------------------------------------- /mit.LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) The pip developers (see AUTHORS.rst file) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >= 50", "wheel", "setuptools_scm[toml] >= 6"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [tool.setuptools_scm] 6 | # this is used populated when creating a git archive 7 | # and when there is .git dir and/or there is no git installed 8 | fallback_version = "9999.4d18bc18-2024-09-02" 9 | 10 | [tool.pytest.ini_options] 11 | norecursedirs = [ 12 | ".git", 13 | "bin", 14 | "dist", 15 | "build", 16 | "_build", 17 | "dist", 18 | "etc", 19 | "local", 20 | "ci", 21 | "docs", 22 | "man", 23 | "share", 24 | "samples", 25 | ".cache", 26 | ".settings", 27 | "Include", 28 | "include", 29 | "Lib", 30 | "lib", 31 | "lib64", 32 | "Lib64", 33 | "Scripts", 34 | "thirdparty", 35 | "tmp", 36 | "venv", 37 | "tests/data", 38 | ".eggs", 39 | "src/*/data", 40 | "tests/*/data" 41 | ] 42 | 43 | python_files = "*.py" 44 | 45 | python_classes = "Test" 46 | python_functions = "test" 47 | 48 | addopts = [ 49 | "-rfExXw", 50 | "--strict-markers", 51 | "--doctest-modules" 52 | ] 53 | -------------------------------------------------------------------------------- /requirements-dev.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | packaging -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [metadata] 2 | name = pip-requirements-parser 3 | license = MIT 4 | 5 | # description must be on ONE line https://github.com/pypa/setuptools/issues/1390 6 | description = pip requirements parser - a mostly correct pip requirements parsing library because it uses pip's own code. 7 | long_description = file:README.rst 8 | long_description_content_type = text/x-rst 9 | url = https://github.com/aboutcode-org/pip-requirements-parser 10 | 11 | author = The pip authors, nexB. Inc. and others 12 | author_email = info@aboutcode.org 13 | 14 | classifiers = 15 | Development Status :: 5 - Production/Stable 16 | Intended Audience :: Developers 17 | Programming Language :: Python :: 3 18 | Programming Language :: Python :: 3 :: Only 19 | Topic :: Software Development 20 | Topic :: Utilities 21 | 22 | keywords = 23 | utilities pip requirements parser dependencies pypi 24 | 25 | license_files = 26 | mit.LICENSE 27 | AUTHORS.rst 28 | CHANGELOG.rst 29 | README.rst 30 | CODE_OF_CONDUCT.rst 31 | 32 | [options] 33 | package_dir = 34 | =src 35 | packages = find: 36 | include_package_data = true 37 | py_modules = 38 | pip_requirements_parser 39 | packaging_legacy_version 40 | zip_safe = false 41 | 42 | setup_requires = setuptools_scm[toml] >= 4 43 | 44 | python_requires = >=3.7 45 | 46 | install_requires = 47 | packaging 48 | pyparsing 49 | 50 | 51 | [options.packages.find] 52 | where = src 53 | 54 | 55 | [options.extras_require] 56 | testing = 57 | pytest >= 6, != 7.0.0 58 | pytest-xdist >= 2 59 | aboutcode-toolkit >= 7.0.2 60 | pycodestyle >= 2.8.0 61 | twine 62 | black 63 | isort 64 | 65 | docs = 66 | Sphinx>=5.0.2 67 | sphinx-rtd-theme>=1.0.0 68 | sphinx-reredirects >= 0.1.2 69 | doc8>=0.11.2 70 | sphinx-autobuild 71 | sphinx-rtd-dark-mode>=1.3.0 72 | sphinx-copybutton 73 | 74 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import setuptools 4 | 5 | if __name__ == "__main__": 6 | setuptools.setup() 7 | -------------------------------------------------------------------------------- /src/packaging_legacy_version.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: 2 | packaging_legacy_version.py 3 | name: packaging 4 | description: Core utilities for Python packages 5 | homepage_url: https://github.com/pypa/packaging 6 | version: 21.4.dev0 7 | license_expression: BSD-2-Clause or Apache-2.0 8 | copyright: copyright (c) Donald Stufft and individual contributors 9 | -------------------------------------------------------------------------------- /src/packaging_legacy_version.py.LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /src/packaging_legacy_version.py.LICENSE.BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) Donald Stufft and individual contributors. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) The pip developers (see AUTHORS.txt file) 3 | # SPDX-License-Identifier: MIT 4 | 5 | from typing import Iterator 6 | 7 | import py.path 8 | import pytest 9 | 10 | from pip_requirements_parser_tests.lib import TestData 11 | from pip_requirements_parser_tests.lib.path import Path 12 | 13 | 14 | 15 | @pytest.fixture 16 | def tmpdir( 17 | request: pytest.FixtureRequest, # NOQA 18 | tmpdir: py.path.local, 19 | ) -> Iterator[Path]: 20 | """ 21 | Return a temporary directory path object which is unique to each test 22 | function invocation, created as a sub directory of the base temporary 23 | directory. The returned object is a ``tests.lib.path.Path`` object. 24 | 25 | This uses the built-in tmpdir fixture from pytest itself but modified 26 | to return our typical path object instead of py.path.local as well as 27 | deleting the temporary directories at the end of each test case. 28 | """ 29 | assert tmpdir.isdir() 30 | yield Path(str(tmpdir)) 31 | # Clear out the temporary directory after the test has finished using it. 32 | # This should prevent us from needing a multiple gigabyte temporary 33 | # directory while running the tests. 34 | tmpdir.remove(ignore_errors=True) 35 | 36 | 37 | @pytest.fixture 38 | def data(tmpdir: Path) -> TestData: 39 | return TestData.copy(tmpdir.joinpath("data")) 40 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aboutcode-org/pip-requirements-parser/4d18bc186553ca6ce619049dfdd63d4100f504a3/tests/pip_requirements_parser_tests/__init__.py -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/Alzon-senlin-requirements.txt: -------------------------------------------------------------------------------- 1 | # The order of packages is significant, because pip processes them in the order 2 | # of appearance. Changing the order has an impact on the overall integration 3 | # process, which may cause wedges in the gate later. 4 | 5 | pbr>=1.6 6 | argparse 7 | Babel>=1.3 8 | croniter>=0.3.4 # MIT License 9 | cryptography>=1.0 # Apache-2.0 10 | eventlet>=0.17.4 11 | keystonemiddleware>=2.0.0 12 | kombu>=3.0.7 13 | openstacksdk 14 | oslo.config>=2.3.0 # Apache-2.0 15 | oslo.context>=0.2.0 # Apache-2.0 16 | oslo.db>=2.4.1 # Apache-2.0 17 | oslo.i18n>=1.5.0 # Apache-2.0 18 | oslo.log>=1.8.0 # Apache-2.0 19 | oslo.messaging!=1.17.0,!=1.17.1,>=1.16.0 # Apache-2.0 20 | oslo.middleware>=2.8.0 # Apache-2.0 21 | oslo.policy>=0.5.0 # Apache-2.0 22 | oslo.serialization>=1.4.0 # Apache-2.0 23 | oslo.service>=0.7.0 # Apache-2.0 24 | oslo.utils>=2.0.0 # Apache-2.0 25 | PasteDeploy>=1.5.0 26 | pytz>=2013.6 27 | PyYAML>=3.1.0 28 | qpid-python;python_version=='2.7' 29 | requests>=2.5.2 30 | Routes!=2.0,!=2.1,>=1.12.3;python_version=='2.7' 31 | Routes!=2.0,>=1.12.3;python_version!='2.7' 32 | six>=1.9.0 33 | SQLAlchemy<1.1.0,>=0.9.9 34 | sqlalchemy-migrate>=0.9.6 35 | stevedore>=1.5.0 # Apache-2.0 36 | WebOb>=1.2.3 37 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/Alzon-senlin-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # The order of packages is significant, because pip processes them in the order 2 | # of appearance. Changing the order has an impact on the overall integration 3 | # process, which may cause wedges in the gate later. 4 | 5 | pbr>=1.6 6 | argparse 7 | Babel>=1.3 8 | croniter>=0.3.4 # MIT License 9 | cryptography>=1.0 # Apache-2.0 10 | eventlet>=0.17.4 11 | keystonemiddleware>=2.0.0 12 | kombu>=3.0.7 13 | openstacksdk 14 | oslo.config>=2.3.0 # Apache-2.0 15 | oslo.context>=0.2.0 # Apache-2.0 16 | oslo.db>=2.4.1 # Apache-2.0 17 | oslo.i18n>=1.5.0 # Apache-2.0 18 | oslo.log>=1.8.0 # Apache-2.0 19 | oslo.messaging>=1.16.0,!=1.17.0,!=1.17.1 # Apache-2.0 20 | oslo.middleware>=2.8.0 # Apache-2.0 21 | oslo.policy>=0.5.0 # Apache-2.0 22 | oslo.serialization>=1.4.0 # Apache-2.0 23 | oslo.service>=0.7.0 # Apache-2.0 24 | oslo.utils>=2.0.0 # Apache-2.0 25 | PasteDeploy>=1.5.0 26 | pytz>=2013.6 27 | PyYAML>=3.1.0 28 | qpid-python; python_version == "2.7" 29 | requests>=2.5.2 30 | Routes>=1.12.3,!=2.0,!=2.1; python_version == "2.7" 31 | Routes>=1.12.3,!=2.0; python_version != "2.7" 32 | six>=1.9.0 33 | SQLAlchemy>=0.9.9,<1.1.0 34 | sqlalchemy-migrate>=0.9.6 35 | stevedore>=1.5.0 # Apache-2.0 36 | WebOb>=1.2.3 37 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/CyrilPeponnet-Unify-whisper-requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+https://github.com/wteiken/letsencrypt@add_dns01_challenge#subdirectory=acme&egg=acme[dns] 2 | boto3>=1.2.3 3 | cryptography>=1.1.2 4 | pyopenssl>=0.15.1 5 | python-consul 6 | docopt 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/CyrilPeponnet-Unify-whisper-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable git+https://github.com/wteiken/letsencrypt@add_dns01_challenge#subdirectory=acme&egg=acme[dns] 2 | boto3>=1.2.3 3 | cryptography>=1.1.2 4 | pyopenssl>=0.15.1 5 | python-consul 6 | docopt 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/Elchi3-kuma-requirements-dev.txt: -------------------------------------------------------------------------------- 1 | # These requirements are for development and include the default requirements 2 | -r default.txt 3 | 4 | # Extract messages from Django templates 5 | django-babel==0.4.0 \ 6 | --hash=sha256:0cf070be3fc0d8628b008da697aa5c0f89bd62c8dd9238283d5bcdbce70bbec6 \ 7 | --hash=sha256:b328dae0e594031d7b0ffded51fd6df60677d4509aee3677013a3a2f76da4e70 8 | 9 | # Analyze Django performance during request 10 | django-debug-toolbar==1.4 \ 11 | --hash=sha256:0cbae8760f4851d480a70b72ace5b075f8191ecf899bc97427715e50fb0e90b9 \ 12 | --hash=sha256:852a37b80df9597048591ebc87d0ce85a4edceaef015dc5360ad89cc5960c27b 13 | 14 | # Code quality checker 15 | flake8==3.1.1 \ 16 | --hash=sha256:898dd353948860c25569cc2298942d20f021021d920dc553dc35f732ee647794 \ 17 | --hash=sha256:941fa78f61f2524cb7aee4aa4fe9876f4b0dcf5aba9fabd3e780d24918f498b7 18 | 19 | # Calculate hashes for pip 8.x+ 20 | hashin==0.6.0 \ 21 | --hash=sha256:8d54551aae64dc8c135dfd5c89efd81a5014f7ce79da642b3fc3eef44ccf7a26 \ 22 | --hash=sha256:7563490ec8c9c361e48c7623898b3585143d379714a03bee4c3d52fb13e85086 23 | 24 | # Test mocks, added to the Python 3 standard library 25 | mock==1.3.0 \ 26 | --hash=sha256:3f573a18be94de886d1191f27c168427ef693e8dcfcecf95b170577b2eb69cbb \ 27 | --hash=sha256:1e247dbecc6ce057299eb7ee019ad68314bb93152e81d9a6110d35f4d5eca0f6 28 | 29 | # Better test runner, related plugins 30 | pytest==2.8.7 \ 31 | --hash=sha256:33612ed6de42f05640fe058aafdf08899eabcb210da74aeb0b788de9695c8bb5 \ 32 | --hash=sha256:fc4c86be54fce08e4b85b646a736efa18c6cde7599c1d2919f4f74629e018baf 33 | pytest-cov==2.2.1 \ 34 | --hash=sha256:a8b22e53e7f3b971454c35df99dffe21f4749f539491e935c55d3ff7e1b284fa \ 35 | --hash=sha256:40bfd01002ceaf9e6c5d371d3c4d541d378a4214ea03e45f934980766a809384 36 | pytest-django==2.9.1 \ 37 | --hash=sha256:8be15b637738c8cbd1422a6461465c0aeab7839cf76ad2b5d190b6f1f53facd6 \ 38 | --hash=sha256:743d0056e127ef424850ea76d93d45c92c313da0e56765806a59fc7680c25ab7 39 | 40 | # Run tests in a virtual environment 41 | tox==2.3.1 \ 42 | --hash=sha256:1823c93ca378092c10bbde428213d3f5066b30adb09e5c001087a83e3e0a402a \ 43 | --hash=sha256:bf7fcc140863820700d3ccd65b33820ba747b61c5fe4e2b91bb8c64cb21a47ee 44 | 45 | # Enables ./manage.py runserver_plus with in-browser exception debugging 46 | Werkzeug==0.11.4 \ 47 | --hash=sha256:7db3cb2d4725be0680abf64a45b18229186f03ad8b9989abbe053f9357b17b37 \ 48 | --hash=sha256:e48fb7e3f2bb5a740dd9a666624699a4d83e2e028555f9c46bcc8ecfc2cd8c32 49 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/TechAtNYU-overlord-requirements.txt: -------------------------------------------------------------------------------- 1 | git+ssh://git@github.com/techatnyu/pytnyu.git 2 | 3 | amqp==1.4.6 4 | anyjson==0.3.3 5 | Babel==1.3 6 | backports.ssl-match-hostname==3.4.0.2 7 | billiard==3.3.0.20 8 | celery==3.1.18 9 | certifi==2015.4.28 10 | chardet==2.3.0 11 | Cheetah==2.4.4 12 | circleclient==0.1.6 13 | colorama==0.2.5 14 | configobj==4.7.2 15 | ecdsa==0.13 16 | Flask==0.10.1 17 | Flask-API==0.6.3 18 | flower==0.8.2 19 | futures==3.0.3 20 | html5lib==0.999 21 | itsdangerous==0.24 22 | Jinja2==2.7.3 23 | jsonpatch==1.3 24 | jsonpointer==1.0 25 | kombu==3.0.26 26 | Markdown==2.6.5 27 | MarkupSafe==0.23 28 | meld3==1.0.2 29 | oauth==1.0.1 30 | paramiko==1.15.2 31 | prettytable==0.7.2 32 | pycrypto==2.6.1 33 | pyserial==2.6 34 | python-dateutil==2.4.2 35 | pytz==2015.4 36 | PyYAML==3.10 37 | requests==2.2.1 38 | sendgrid==1.4.0 39 | six==1.5.2 40 | smtpapi==0.2.0 41 | spur==0.3.14 42 | stripe==1.27.1 43 | supervisor==3.2.0 44 | tornado==4.2 45 | urllib3==1.7.1 46 | Werkzeug==0.10.4 47 | wheel==0.24.0 48 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/TechAtNYU-overlord-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | git+ssh://git@github.com/techatnyu/pytnyu.git 2 | 3 | amqp==1.4.6 4 | anyjson==0.3.3 5 | Babel==1.3 6 | backports.ssl-match-hostname==3.4.0.2 7 | billiard==3.3.0.20 8 | celery==3.1.18 9 | certifi==2015.4.28 10 | chardet==2.3.0 11 | Cheetah==2.4.4 12 | circleclient==0.1.6 13 | colorama==0.2.5 14 | configobj==4.7.2 15 | ecdsa==0.13 16 | Flask==0.10.1 17 | Flask-API==0.6.3 18 | flower==0.8.2 19 | futures==3.0.3 20 | html5lib==0.999 21 | itsdangerous==0.24 22 | Jinja2==2.7.3 23 | jsonpatch==1.3 24 | jsonpointer==1.0 25 | kombu==3.0.26 26 | Markdown==2.6.5 27 | MarkupSafe==0.23 28 | meld3==1.0.2 29 | oauth==1.0.1 30 | paramiko==1.15.2 31 | prettytable==0.7.2 32 | pycrypto==2.6.1 33 | pyserial==2.6 34 | python-dateutil==2.4.2 35 | pytz==2015.4 36 | PyYAML==3.10 37 | requests==2.2.1 38 | sendgrid==1.4.0 39 | six==1.5.2 40 | smtpapi==0.2.0 41 | spur==0.3.14 42 | stripe==1.27.1 43 | supervisor==3.2.0 44 | tornado==4.2 45 | urllib3==1.7.1 46 | Werkzeug==0.10.4 47 | wheel==0.24.0 48 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/UQ-UQx-edx-platform_lti-requirements-edx-edx-private.txt: -------------------------------------------------------------------------------- 1 | # Requirements for edx.org that aren't necessarily needed for Open edX. 2 | 3 | -e git+https://github.com/gsehub/xblock-mentoring.git@4d1cce78dc232d5da6ffd73817b5c490e87a6eee#egg=xblock-mentoring 4 | 5 | # Prototype XBlocks from edX learning sciences limited roll-outs and user testing. 6 | # Concept XBlock, in particular, is nowhere near finished and an early prototype. 7 | # Profile XBlock is there so we can play with XBlock arguments in the platform, but isn't ready for use outside of 8 | # edX. 9 | 10 | -e git+https://github.com/pmitros/ConceptXBlock.git@2376fde9ebdd83684b78dde77ef96361c3bd1aa0#egg=concept-xblock 11 | -e git+https://github.com/pmitros/DoneXBlock.git@1ce0ac14d9f3df3083b951262ec82e84b58d16d1#egg=done-xblock 12 | -e git+https://github.com/pmitros/AudioXBlock.git@1fbf19cc21613aead62799469e1593adb037fdd9#egg=audio-xblock 13 | -e git+https://github.com/pmitros/AnimationXBlock.git@d2b551bb8f49a138088e10298576102164145b87#egg=animation-xblock 14 | -e git+https://github.com/pmitros/ProfileXBlock.git@4aeaa24aa2bc7d9cb2d2bb60d6f05def3b856be0#egg=profile-xblock 15 | 16 | # This repository contains schoolyourself-xblock, which is used in 17 | # edX's "AlgebraX" and "GeometryX" courses. 18 | -e git+https://github.com/schoolyourself/schoolyourself-xblock.git@ae028c3c185d1abf93823f7a5d946a8e66b8e7d9#egg=schoolyourself-xblock 19 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/UQ-UQx-edx-platform_lti-requirements-edx-edx-private.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # Requirements for edx.org that aren't necessarily needed for Open edX. 2 | 3 | --editable git+https://github.com/gsehub/xblock-mentoring.git@4d1cce78dc232d5da6ffd73817b5c490e87a6eee#egg=xblock-mentoring 4 | 5 | # Prototype XBlocks from edX learning sciences limited roll-outs and user testing. 6 | # Concept XBlock, in particular, is nowhere near finished and an early prototype. 7 | # Profile XBlock is there so we can play with XBlock arguments in the platform, but isn't ready for use outside of 8 | # edX. 9 | 10 | --editable git+https://github.com/pmitros/ConceptXBlock.git@2376fde9ebdd83684b78dde77ef96361c3bd1aa0#egg=concept-xblock 11 | --editable git+https://github.com/pmitros/DoneXBlock.git@1ce0ac14d9f3df3083b951262ec82e84b58d16d1#egg=done-xblock 12 | --editable git+https://github.com/pmitros/AudioXBlock.git@1fbf19cc21613aead62799469e1593adb037fdd9#egg=audio-xblock 13 | --editable git+https://github.com/pmitros/AnimationXBlock.git@d2b551bb8f49a138088e10298576102164145b87#egg=animation-xblock 14 | --editable git+https://github.com/pmitros/ProfileXBlock.git@4aeaa24aa2bc7d9cb2d2bb60d6f05def3b856be0#egg=profile-xblock 15 | 16 | # This repository contains schoolyourself-xblock, which is used in 17 | # edX's "AlgebraX" and "GeometryX" courses. 18 | --editable git+https://github.com/schoolyourself/schoolyourself-xblock.git@ae028c3c185d1abf93823f7a5d946a8e66b8e7d9#egg=schoolyourself-xblock 19 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/Winterflower-ibis-requirements.txt: -------------------------------------------------------------------------------- 1 | pytest 2 | numpy>=1.7.0 3 | pandas>=0.12.0 4 | impyla>=0.9.1 5 | psutil==0.6.1 6 | snakebite 7 | hdfs[kerberos]>=1.1.1 8 | six 9 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/Winterflower-ibis-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | pytest 2 | numpy>=1.7.0 3 | pandas>=0.12.0 4 | impyla>=0.9.1 5 | psutil==0.6.1 6 | snakebite 7 | hdfs[kerberos]>=1.1.1 8 | six 9 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/alexandermendes-pybossa-github-builder-requirements.txt: -------------------------------------------------------------------------------- 1 | --index-url https://pypi.python.org/simple/ 2 | 3 | GitHub-Flask 4 | jsonschema -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/alexandermendes-pybossa-github-builder-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --index-url https://pypi.python.org/simple/ 2 | 3 | GitHub-Flask 4 | jsonschema 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/alexandermendes-pybossa-github-builder-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [ 3 | { 4 | "line_number": 1, 5 | "line": "--index-url https://pypi.python.org/simple/", 6 | "index_url": "https://pypi.python.org/simple/" 7 | } 8 | ], 9 | "requirements": [ 10 | { 11 | "name": "GitHub-Flask", 12 | "specifier": [], 13 | "is_editable": false, 14 | "is_pinned": false, 15 | "requirement_line": { 16 | "line_number": 3, 17 | "line": "GitHub-Flask" 18 | }, 19 | "link": null, 20 | "marker": null, 21 | "install_options": [], 22 | "global_options": [], 23 | "hash_options": [], 24 | "is_constraint": false, 25 | "extras": [], 26 | "invalid_options": {}, 27 | "is_archive": null, 28 | "is_wheel": false, 29 | "is_url": null, 30 | "is_vcs_url": null, 31 | "is_name_at_url": false, 32 | "is_local_path": null, 33 | "has_egg_fragment": false 34 | }, 35 | { 36 | "name": "jsonschema", 37 | "specifier": [], 38 | "is_editable": false, 39 | "is_pinned": false, 40 | "requirement_line": { 41 | "line_number": 4, 42 | "line": "jsonschema" 43 | }, 44 | "link": null, 45 | "marker": null, 46 | "install_options": [], 47 | "global_options": [], 48 | "hash_options": [], 49 | "is_constraint": false, 50 | "extras": [], 51 | "invalid_options": {}, 52 | "is_archive": null, 53 | "is_wheel": false, 54 | "is_url": null, 55 | "is_vcs_url": null, 56 | "is_name_at_url": false, 57 | "is_local_path": null, 58 | "has_egg_fragment": false 59 | } 60 | ], 61 | "invalid_lines": [], 62 | "comments": [] 63 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/andymckay-olympia-requirements-prod.txt: -------------------------------------------------------------------------------- 1 | -r compiled.txt 2 | 3 | amo-validator==1.10.26 --hash=sha256:8df960d43929cf273654cde8694bab8a5bbe324c2acd828a8038153a904bed92 4 | amqp==1.4.9 --hash=sha256:e0ed0ce6b8ffe5690a2e856c7908dc557e0e605283d6885dd1361d79f2928908 5 | anyjson==0.3.3 --hash=sha256:5dbf34bd42d22c01fcc48be4735538e8206d6c14253abd19fd98fc0ad92092da \ 6 | --hash=sha256:37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/andymckay-olympia-requirements-prod.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --requirement compiled.txt 2 | 3 | amo-validator==1.10.26 \ 4 | --hash=sha256:8df960d43929cf273654cde8694bab8a5bbe324c2acd828a8038153a904bed92 5 | amqp==1.4.9 \ 6 | --hash=sha256:e0ed0ce6b8ffe5690a2e856c7908dc557e0e605283d6885dd1361d79f2928908 7 | anyjson==0.3.3 \ 8 | --hash=sha256:5dbf34bd42d22c01fcc48be4735538e8206d6c14253abd19fd98fc0ad92092da \ 9 | --hash=sha256:37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba 10 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/bigzachattack-dockerspawner-requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+https://github.com/jupyter/jupyterhub.git#egg=jupyterhub 2 | -e git+https://github.com/ipython/ipython.git#egg=ipython[notebook] 3 | docker-py 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/bigzachattack-dockerspawner-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable git+https://github.com/jupyter/jupyterhub.git#egg=jupyterhub 2 | --editable git+https://github.com/ipython/ipython.git#egg=ipython[notebook] 3 | docker-py 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/brutus-templator-requirements.txt: -------------------------------------------------------------------------------- 1 | git+https://git@bitbucket.org/brutusdmc/corelib.git#egg=corelib[full] 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/brutus-templator-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | git+https://git@bitbucket.org/brutusdmc/corelib.git#egg=corelib[full] 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/brutus-templator-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "corelib", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "git+https://git@bitbucket.org/brutusdmc/corelib.git#egg=corelib[full]" 12 | }, 13 | "link": "git+https://git@bitbucket.org/brutusdmc/corelib.git#egg=corelib[full]", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [ 20 | "full" 21 | ], 22 | "invalid_options": {}, 23 | "is_archive": false, 24 | "is_wheel": false, 25 | "is_url": true, 26 | "is_vcs_url": true, 27 | "is_name_at_url": false, 28 | "is_local_path": true, 29 | "has_egg_fragment": true 30 | } 31 | ], 32 | "invalid_lines": [], 33 | "comments": [] 34 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/buildtimetrend-python-client-requirements-native.txt: -------------------------------------------------------------------------------- 1 | git+https://github.com/buildtimetrend/python-lib.git#egg=buildtimetrend[native]>=0.4.dev4 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/buildtimetrend-python-client-requirements-native.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | git+https://github.com/buildtimetrend/python-lib.git#egg=buildtimetrend[native]>=0.4.dev4 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/buildtimetrend-python-client-requirements-native.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "buildtimetrend", 6 | "specifier": [ 7 | ">=0.4.dev4" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": false, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "git+https://github.com/buildtimetrend/python-lib.git#egg=buildtimetrend[native]>=0.4.dev4" 14 | }, 15 | "link": "git+https://github.com/buildtimetrend/python-lib.git#egg=buildtimetrend[native]>=0.4.dev4", 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [ 22 | "native" 23 | ], 24 | "invalid_options": {}, 25 | "is_archive": false, 26 | "is_wheel": false, 27 | "is_url": true, 28 | "is_vcs_url": true, 29 | "is_name_at_url": false, 30 | "is_local_path": true, 31 | "has_egg_fragment": true 32 | } 33 | ], 34 | "invalid_lines": [], 35 | "comments": [] 36 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/freedomsponsors-www.freedomsponsors.org-requirements.txt: -------------------------------------------------------------------------------- 1 | django==1.6.5 2 | splinter==0.5.4 3 | Pygments==1.5 4 | misaka==1.0.2 5 | psycopg2==2.4.5 6 | simplejson==2.6.2 7 | coverage==3.6b1 8 | python-dateutil==2.1 9 | six==1.2.0 10 | Unipath==0.2.1 11 | dj-database-url==0.2.1 12 | httplib2==0.7.7 13 | python-openid==2.2.5 14 | requests-oauthlib==0.4.2 15 | #python-social-auth==0.2.1 16 | git+git://github.com/cambonf/python-social-auth.git@68041313935c78d5045643cca7d2becbdbdf0438#egg=python-social-auth 17 | requests==2.5.1 18 | django-pagination==1.0.7 19 | south==0.7.5 20 | bitcoin-python==0.3 21 | git+git://github.com/pinax/django-mailer.git@887ec2c9d8e05d061293b56ff913a9b293c42aa0#egg=django-mailer 22 | git+git://github.com/freedomsponsors/python-paypalx.git@34d624ed8a7b6505aa6e6e12c0a5b854cacbc612#egg=paypalx 23 | 24 | # Both django-registration v0.8 and v1.0 have compatibility issues with Django 1.6.5. 25 | # See refs: 26 | # http://stackoverflow.com/questions/19985103/django-1-6-and-django-registration-built-in-authentication-views-not-picked-up 27 | # https://bitbucket.org/ubernostrum/django-registration/pull-request/63/django-16-compatibility-fix-auth-views/diff 28 | # 29 | # Below github fork targets a Django-1.6-compatible version of django-registration package, which is a good starting point 30 | # to twist for Django 1.6.5. 31 | git+git://github.com/macropin/django-registration.git@42f66646a5e8a80bf1250fe03fb4738b9cde6593#egg=django-registration 32 | 33 | # This new version of django-emailmgr is already compatible with django 1.6. It's not on pypi yet though. 34 | git+git://github.com/un33k/django-emailmgr.git@7a6454346dc962ba3550821d51c311a4f69967ba#egg=django-emailmgr 35 | 36 | Pillow==3.1.0 37 | mock==1.0.1 38 | html2text==2014.7.3 39 | django-recaptcha==1.0.5 -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/freedomsponsors-www.freedomsponsors.org-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | django==1.6.5 2 | splinter==0.5.4 3 | Pygments==1.5 4 | misaka==1.0.2 5 | psycopg2==2.4.5 6 | simplejson==2.6.2 7 | coverage==3.6b1 8 | python-dateutil==2.1 9 | six==1.2.0 10 | Unipath==0.2.1 11 | dj-database-url==0.2.1 12 | httplib2==0.7.7 13 | python-openid==2.2.5 14 | requests-oauthlib==0.4.2 15 | #python-social-auth==0.2.1 16 | git+git://github.com/cambonf/python-social-auth.git@68041313935c78d5045643cca7d2becbdbdf0438#egg=python-social-auth 17 | requests==2.5.1 18 | django-pagination==1.0.7 19 | south==0.7.5 20 | bitcoin-python==0.3 21 | git+git://github.com/pinax/django-mailer.git@887ec2c9d8e05d061293b56ff913a9b293c42aa0#egg=django-mailer 22 | git+git://github.com/freedomsponsors/python-paypalx.git@34d624ed8a7b6505aa6e6e12c0a5b854cacbc612#egg=paypalx 23 | 24 | # Both django-registration v0.8 and v1.0 have compatibility issues with Django 1.6.5. 25 | # See refs: 26 | # http://stackoverflow.com/questions/19985103/django-1-6-and-django-registration-built-in-authentication-views-not-picked-up 27 | # https://bitbucket.org/ubernostrum/django-registration/pull-request/63/django-16-compatibility-fix-auth-views/diff 28 | # 29 | # Below github fork targets a Django-1.6-compatible version of django-registration package, which is a good starting point 30 | # to twist for Django 1.6.5. 31 | git+git://github.com/macropin/django-registration.git@42f66646a5e8a80bf1250fe03fb4738b9cde6593#egg=django-registration 32 | 33 | # This new version of django-emailmgr is already compatible with django 1.6. It's not on pypi yet though. 34 | git+git://github.com/un33k/django-emailmgr.git@7a6454346dc962ba3550821d51c311a4f69967ba#egg=django-emailmgr 35 | 36 | Pillow==3.1.0 37 | mock==1.0.1 38 | html2text==2014.7.3 39 | django-recaptcha==1.0.5 40 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/freeekanayaka-systemfixtures-requirements.txt: -------------------------------------------------------------------------------- 1 | pbr 2 | six 3 | fixtures 4 | testtools 5 | requests-mock 6 | fakesleep 7 | subprocess32; python_version < '3.5' 8 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/freeekanayaka-systemfixtures-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | pbr 2 | six 3 | fixtures 4 | testtools 5 | requests-mock 6 | fakesleep 7 | subprocess32; python_version < "3.5" 8 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/indodutch-sim-city-webservice-requirements.txt: -------------------------------------------------------------------------------- 1 | accept-types==0.3.0 2 | bottle==0.12.9 3 | CouchDB==1.1 4 | flake8==3.0.4 5 | gevent==1.1.2 6 | greenlet==0.4.10 7 | ijson==2.3 8 | JPype1==0.6.1 9 | jsonschema==2.5.1 10 | mccabe==0.5.2 11 | py==1.4.31 12 | pycodestyle==2.0.0 13 | pyflakes==1.2.3 14 | pystache==0.5.4 15 | pytest==3.0.1 16 | pytest-flake8==0.6 17 | pyxenon==0.2.2 18 | PyYAML==3.11 19 | requests==2.11.1 20 | tqdm==4.8.4 21 | -e git+https://github.com/indodutch/sim-city-client.git@develop#egg=simcity-0.4[xenon] 22 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/indodutch-sim-city-webservice-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | accept-types==0.3.0 2 | bottle==0.12.9 3 | CouchDB==1.1 4 | flake8==3.0.4 5 | gevent==1.1.2 6 | greenlet==0.4.10 7 | ijson==2.3 8 | JPype1==0.6.1 9 | jsonschema==2.5.1 10 | mccabe==0.5.2 11 | py==1.4.31 12 | pycodestyle==2.0.0 13 | pyflakes==1.2.3 14 | pystache==0.5.4 15 | pytest==3.0.1 16 | pytest-flake8==0.6 17 | pyxenon==0.2.2 18 | PyYAML==3.11 19 | requests==2.11.1 20 | tqdm==4.8.4 21 | --editable git+https://github.com/indodutch/sim-city-client.git@develop#egg=simcity-0.4[xenon] 22 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/jacobzweig-RCNN_Toolbox-requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile 3 | # Make changes in requirements.in, then run this to update: 4 | # 5 | # pip-compile requirements.in 6 | # 7 | Theano==0.8.0 8 | -e git+https://github.com/Lasagne/Lasagne.git@8f4f9b2#egg=Lasagne==0.2.git 9 | -e git+https://github.com/dnouri/nolearn.git@master#egg=nolearn==0.7.git 10 | cycler==0.9.0 # via matplotlib 11 | joblib==0.9.3 12 | matplotlib==1.5.0 13 | numpy 14 | pyparsing==2.0.6 # via matplotlib 15 | python-dateutil==2.4.2 # via matplotlib 16 | pytz==2015.7 # via matplotlib 17 | pyyaml==3.11 18 | scikit-learn 19 | scipy 20 | six==1.10.0 # via cycler, python-dateutil 21 | tabulate==0.7.5 22 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/jacobzweig-RCNN_Toolbox-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile 3 | # Make changes in requirements.in, then run this to update: 4 | # 5 | # pip-compile requirements.in 6 | # 7 | Theano==0.8.0 8 | # Invalid requirement: 'Lasagne==0.2.git': Expected end or semicolon (after version specifier) 9 | Lasagne==0.2.git 10 | ~~~~~^ 11 | -e git+https://github.com/Lasagne/Lasagne.git@8f4f9b2#egg=Lasagne==0.2.git 12 | # Invalid requirement: 'nolearn==0.7.git': Expected end or semicolon (after version specifier) 13 | nolearn==0.7.git 14 | ~~~~~^ 15 | -e git+https://github.com/dnouri/nolearn.git@master#egg=nolearn==0.7.git 16 | cycler==0.9.0 # via matplotlib 17 | joblib==0.9.3 18 | matplotlib==1.5.0 19 | numpy 20 | pyparsing==2.0.6 # via matplotlib 21 | python-dateutil==2.4.2 # via matplotlib 22 | pytz==2015.7 # via matplotlib 23 | pyyaml==3.11 24 | scikit-learn 25 | scipy 26 | six==1.10.0 # via cycler, python-dateutil 27 | tabulate==0.7.5 28 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/jonaqp-django_mongo-requirements-req.txt: -------------------------------------------------------------------------------- 1 | amqp==1.4.9 2 | anyjson==0.3.3 3 | astroid==1.4.6 4 | backports-abc==0.4 5 | backports.shutil-get-terminal-size==1.0.0 6 | billiard==3.3.0.23 7 | boto==2.40.0 8 | click==6.6 9 | colorama==0.3.7 10 | coverage==4.1 11 | decorator==4.0.10 12 | dj-database-url==0.4.1 13 | dj-static==0.0.6 14 | Django==1.9.6 15 | django-celery==3.1.17 16 | django-debug-toolbar==1.4 17 | django-environ==0.4.0 18 | django-extensions==1.6.7 19 | django-mongodb-engine-py3==0.6.0.1 20 | django-redis==4.4.3 21 | django-rest-framework-mongoengine==3.3.0 22 | django-sites==0.9 23 | django-storages==1.4.1 24 | django-toolbelt==0.0.1 25 | djangorestframework==3.3.3 26 | djangotoolbox==1.8.0 27 | gunicorn==19.6.0 28 | ipdb==0.10.0 29 | ipython==4.2.0 30 | ipython-genutils==0.1.0 31 | Jinja2==2.8 32 | kombu==3.0.35 33 | lazy-object-proxy==1.2.2 34 | livereload==2.4.1 35 | Markdown==2.6.6 36 | MarkupSafe==0.23 37 | mkdocs==0.15.3 38 | mkdocs-bootstrap==0.1.1 39 | mkdocs-bootswatch==0.4.0 40 | mongoengine==0.10.6 41 | pep8==1.7.0 42 | pickleshare==0.7.2 43 | Pillow==3.2.0 44 | psycopg2==2.6.1 45 | pyflakes==1.2.3 46 | pylint==1.5.6 47 | pymongo==3.2.2 48 | python-redis-lock==3.1.0 49 | pytz==2016.4 50 | PyYAML==3.11 51 | redis==2.10.5 52 | redis-structures==0.1.6 53 | simplegeneric==0.8.1 54 | six==1.10.0 55 | sqlparse==0.1.19 56 | static3==0.7.0 57 | tornado==4.3 58 | traitlets==4.2.1 59 | Wand==0.4.3 60 | wrapt==1.10.8 61 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/jonaqp-django_mongo-requirements-req.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | amqp==1.4.9 2 | anyjson==0.3.3 3 | astroid==1.4.6 4 | backports-abc==0.4 5 | backports.shutil-get-terminal-size==1.0.0 6 | billiard==3.3.0.23 7 | boto==2.40.0 8 | click==6.6 9 | colorama==0.3.7 10 | coverage==4.1 11 | decorator==4.0.10 12 | dj-database-url==0.4.1 13 | dj-static==0.0.6 14 | Django==1.9.6 15 | django-celery==3.1.17 16 | django-debug-toolbar==1.4 17 | django-environ==0.4.0 18 | django-extensions==1.6.7 19 | django-mongodb-engine-py3==0.6.0.1 20 | django-redis==4.4.3 21 | django-rest-framework-mongoengine==3.3.0 22 | django-sites==0.9 23 | django-storages==1.4.1 24 | django-toolbelt==0.0.1 25 | djangorestframework==3.3.3 26 | djangotoolbox==1.8.0 27 | gunicorn==19.6.0 28 | ipdb==0.10.0 29 | ipython==4.2.0 30 | ipython-genutils==0.1.0 31 | Jinja2==2.8 32 | kombu==3.0.35 33 | lazy-object-proxy==1.2.2 34 | livereload==2.4.1 35 | Markdown==2.6.6 36 | MarkupSafe==0.23 37 | mkdocs==0.15.3 38 | mkdocs-bootstrap==0.1.1 39 | mkdocs-bootswatch==0.4.0 40 | mongoengine==0.10.6 41 | pep8==1.7.0 42 | pickleshare==0.7.2 43 | Pillow==3.2.0 44 | psycopg2==2.6.1 45 | pyflakes==1.2.3 46 | pylint==1.5.6 47 | pymongo==3.2.2 48 | python-redis-lock==3.1.0 49 | pytz==2016.4 50 | PyYAML==3.11 51 | redis==2.10.5 52 | redis-structures==0.1.6 53 | simplegeneric==0.8.1 54 | six==1.10.0 55 | sqlparse==0.1.19 56 | static3==0.7.0 57 | tornado==4.3 58 | traitlets==4.2.1 59 | Wand==0.4.3 60 | wrapt==1.10.8 61 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/jorismathijssen-ProjectLipa-James-requirements.txt: -------------------------------------------------------------------------------- 1 | git+https://github.com/Rapptz/discord.py@master#egg=discord.py[voice] 2 | lxml 3 | requests 4 | xmltodict 5 | discord.py 6 | wikia 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/jorismathijssen-ProjectLipa-James-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | git+https://github.com/Rapptz/discord.py@master#egg=discord.py[voice] 2 | lxml 3 | requests 4 | xmltodict 5 | discord.py 6 | wikia 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/maxgraser-seriesly-seriesly-requirements.txt: -------------------------------------------------------------------------------- 1 | -e svn+http://code.djangoproject.com/svn/django/tags/releases/1.1/#egg=django -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/maxgraser-seriesly-seriesly-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable svn+http://code.djangoproject.com/svn/django/tags/releases/1.1/#egg=django 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/maxgraser-seriesly-seriesly-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "django", 6 | "specifier": [], 7 | "is_editable": true, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "-e svn+http://code.djangoproject.com/svn/django/tags/releases/1.1/#egg=django" 12 | }, 13 | "link": "svn+http://code.djangoproject.com/svn/django/tags/releases/1.1/#egg=django", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": false, 23 | "is_url": true, 24 | "is_vcs_url": true, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": true 28 | } 29 | ], 30 | "invalid_lines": [], 31 | "comments": [] 32 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/mbertrand-cga-worldmap-shared-dev-requirements.txt: -------------------------------------------------------------------------------- 1 | werkzeug 2 | django-extensions 3 | Paste 4 | PasteDeploy 5 | PasteScript 6 | dj.paste 7 | django-nose 8 | nose 9 | nose-cover3 10 | coverage==3.4 11 | nosexcover 12 | mock==1.0.0 13 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/mbertrand-cga-worldmap-shared-dev-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | werkzeug 2 | django-extensions 3 | Paste 4 | PasteDeploy 5 | PasteScript 6 | dj.paste 7 | django-nose 8 | nose 9 | nose-cover3 10 | coverage==3.4 11 | nosexcover 12 | mock==1.0.0 13 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/ministryofjustice-elasticsearch-formula-formula-requirements.txt: -------------------------------------------------------------------------------- 1 | git@github.com:ministryofjustice/java-formula.git==v1.0.0 2 | git@github.com:ministryofjustice/python-formula.git==v1.0.1 3 | git@github.com:ministryofjustice/sensu-formula.git==v4.4.0 4 | git@github.com:ministryofjustice/firewall-formula.git==v1.0.1 5 | git@github.com:ministryofjustice/logstash-formula.git==v1.0.0 6 | git@github.com:ministryofjustice/bootstrap-formula.git==v1.0.0 7 | git@github.com:ministryofjustice/apparmor-formula.git==v1.0.0 8 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/ministryofjustice-elasticsearch-formula-formula-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | git@github.com:ministryofjustice/java-formula.git==v1.0.0 2 | git@github.com:ministryofjustice/python-formula.git==v1.0.1 3 | git@github.com:ministryofjustice/sensu-formula.git==v4.4.0 4 | git@github.com:ministryofjustice/firewall-formula.git==v1.0.1 5 | git@github.com:ministryofjustice/logstash-formula.git==v1.0.0 6 | git@github.com:ministryofjustice/bootstrap-formula.git==v1.0.0 7 | git@github.com:ministryofjustice/apparmor-formula.git==v1.0.0 8 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/nikdoof-test-auth-requirements.txt: -------------------------------------------------------------------------------- 1 | xmlrpclib 2 | xmpppy 3 | dnspython 4 | fabric==dev 5 | 6 | Django==1.4.1 7 | MySQL-python 8 | Celery>=3.0 9 | django-celery>=3.0 10 | 11 | django-jsonfield>=0.8.8 12 | South>=0.7 13 | django-redis-cache 14 | IPy==0.75 15 | -e git+https://github.com/nikdoof/django-braces.git@b573a69c06907cff74d3623f61a551ceb264cf08#egg=django-braces 16 | 17 | nexus 18 | gargoyle>=0.10 19 | -e hg+https://bitbucket.org/jespern/django-piston@7c90898072ce#egg=django_piston 20 | -e hg+https://bitbucket.org/ubernostrum/django-registration@27bccd108cde#egg=django-registration 21 | raven>=2.0.3 22 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/nikdoof-test-auth-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | xmlrpclib 2 | xmpppy 3 | dnspython 4 | # Invalid requirement: : Expected end or semicolon (after name and no valid version specifier) 5 | fabric==dev 6 | ^ 7 | fabric==dev 8 | 9 | Django==1.4.1 10 | MySQL-python 11 | Celery>=3.0 12 | django-celery>=3.0 13 | 14 | django-jsonfield>=0.8.8 15 | South>=0.7 16 | django-redis-cache 17 | IPy==0.75 18 | --editable git+https://github.com/nikdoof/django-braces.git@b573a69c06907cff74d3623f61a551ceb264cf08#egg=django-braces 19 | 20 | nexus 21 | gargoyle>=0.10 22 | --editable hg+https://bitbucket.org/jespern/django-piston@7c90898072ce#egg=django_piston 23 | --editable hg+https://bitbucket.org/ubernostrum/django-registration@27bccd108cde#egg=django-registration 24 | raven>=2.0.3 25 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/pamfilos-invenio-requirements.txt: -------------------------------------------------------------------------------- 1 | # Invenio requirements. 2 | MySQL-python==1.2.5 3 | rdflib==2.4.2 4 | reportlab==2.5 5 | python-dateutil<=1.9999 6 | python-magic==0.4.2 7 | http://www.reportlab.com/ftp/pyRXP-1.16-daily-unix.tar.gz 8 | numpy==1.7.0 9 | lxml==3.1.2 10 | mechanize==0.2.5 11 | python-Levenshtein==0.10.2 12 | PyStemmer==1.3.0 13 | https://py-editdist.googlecode.com/files/py-editdist-0.3.tar.gz 14 | feedparser==5.1.3 15 | BeautifulSoup==3.2.1 16 | beautifulsoup4==4.1.3 17 | python-twitter==0.8.7 18 | msgpack-python==0.3.0 19 | pyparsing==1.5.6 20 | requests==2.2.0 21 | PyPDF2==1.19 22 | rauth==0.6.2 23 | unidecode==0.04.14 24 | python-openid==2.2.5 25 | qrcode==4.0.4 26 | pillow==2.3.0 27 | jinja2==2.7.2 28 | redis==2.9.0 29 | nydus==0.10.6 30 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/pamfilos-invenio-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # Invenio requirements. 2 | MySQL-python==1.2.5 3 | rdflib==2.4.2 4 | reportlab==2.5 5 | python-dateutil<=1.9999 6 | python-magic==0.4.2 7 | http://www.reportlab.com/ftp/pyRXP-1.16-daily-unix.tar.gz 8 | numpy==1.7.0 9 | lxml==3.1.2 10 | mechanize==0.2.5 11 | python-Levenshtein==0.10.2 12 | PyStemmer==1.3.0 13 | https://py-editdist.googlecode.com/files/py-editdist-0.3.tar.gz 14 | feedparser==5.1.3 15 | BeautifulSoup==3.2.1 16 | beautifulsoup4==4.1.3 17 | python-twitter==0.8.7 18 | msgpack-python==0.3.0 19 | pyparsing==1.5.6 20 | requests==2.2.0 21 | PyPDF2==1.19 22 | rauth==0.6.2 23 | unidecode==0.04.14 24 | python-openid==2.2.5 25 | qrcode==4.0.4 26 | pillow==2.3.0 27 | jinja2==2.7.2 28 | redis==2.9.0 29 | nydus==0.10.6 30 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/pvernier-elpaso-requirements.txt: -------------------------------------------------------------------------------- 1 | # Common requirements 2 | # ----------------------- 3 | # This file collects all required third-party applications that are needed 4 | # to run this project. Later you can install all these apps in a row 5 | # using pip. Example: 6 | # 7 | # pip install -r REQUIREMENTS.txt 8 | # 9 | 10 | arrow 11 | beautifulsoup4==4.5.* 12 | celery==4.0.*;sys_platform == 'linux2' 13 | celery==3.1.*;sys_platform == 'win32' 14 | Django==1.10.* 15 | django-celery-beat==1.0.* 16 | django-celery-results==1.0.* 17 | django-extensions==1.7.* 18 | django-suit==0.2.* 19 | feedparser==5.2.* 20 | gunicorn==19.0.* 21 | nltk==3.2.* 22 | numpy==1.11.* 23 | pytz 24 | redis==2.10.* 25 | six==1.10.0 26 | 27 | # supervisor==3.2.0 28 | # meld3==1.0.2 29 | 30 | # Details 31 | # meld3 (1.0.2) 32 | # pip (9.0.1) 33 | # setuptools (20.7.0) 34 | # wheel (0.29.0) 35 | # python-dateutil==2.6.* 36 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/pvernier-elpaso-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # Common requirements 2 | # ----------------------- 3 | # This file collects all required third-party applications that are needed 4 | # to run this project. Later you can install all these apps in a row 5 | # using pip. Example: 6 | # 7 | # pip install -r REQUIREMENTS.txt 8 | # 9 | 10 | arrow 11 | beautifulsoup4==4.5.* 12 | celery==4.0.*; sys_platform == "linux2" 13 | celery==3.1.*; sys_platform == "win32" 14 | Django==1.10.* 15 | django-celery-beat==1.0.* 16 | django-celery-results==1.0.* 17 | django-extensions==1.7.* 18 | django-suit==0.2.* 19 | feedparser==5.2.* 20 | gunicorn==19.0.* 21 | nltk==3.2.* 22 | numpy==1.11.* 23 | pytz 24 | redis==2.10.* 25 | six==1.10.0 26 | 27 | # supervisor==3.2.0 28 | # meld3==1.0.2 29 | 30 | # Details 31 | # meld3 (1.0.2) 32 | # pip (9.0.1) 33 | # setuptools (20.7.0) 34 | # wheel (0.29.0) 35 | # python-dateutil==2.6.* 36 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/qvazzler-Flexget-requirements.txt: -------------------------------------------------------------------------------- 1 | FeedParser>=5.2.1 2 | # There is a bug in sqlalchemy 0.9.0, see gh#127 3 | SQLAlchemy >=0.7.5, !=0.9.0, <1.999 4 | PyYAML 5 | # There is a bug in beautifulsoup 4.2.0 that breaks imdb parsing, see http://flexget.com/ticket/2091 6 | beautifulsoup4>=4.1, !=4.2.0, <4.5 7 | html5lib>=0.11 8 | PyRSS2Gen 9 | pynzb 10 | #PY3 progressbar 11 | rpyc 12 | jinja2 13 | # There is a bug in requests 2.4.0 where it leaks urllib3 exceptions 14 | requests>=2.8.0, <3.0 15 | #Guessit requires python-dateutil<=2.5.2 16 | python-dateutil>=2.5.2 17 | jsonschema>=2.0 18 | path.py>=8.1.1 19 | pathlib>=1.0 20 | guessit<=2.0.4 21 | # Bug in apscheduler 3.1.0 https://github.com/agronholm/apscheduler/issues/121 22 | apscheduler>=3.0.3, !=3.1.0 23 | # WebUI Requirements 24 | cherrypy>=3.7.0 25 | flask>=0.7 26 | flask-restful>=0.3.3 27 | flask-restplus==0.8.6 28 | flask-compress>=1.2.1 29 | flask-login>=0.3.2 30 | flask-cors>=2.1.2 31 | pyparsing>=2.0.3 32 | Safe>=0.4 33 | future>=0.15.2 -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/qvazzler-Flexget-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | FeedParser>=5.2.1 2 | # There is a bug in sqlalchemy 0.9.0, see gh#127 3 | SQLAlchemy>=0.7.5,!=0.9.0,<1.999 4 | PyYAML 5 | # There is a bug in beautifulsoup 4.2.0 that breaks imdb parsing, see http://flexget.com/ticket/2091 6 | beautifulsoup4>=4.1,!=4.2.0,<4.5 7 | html5lib>=0.11 8 | PyRSS2Gen 9 | pynzb 10 | #PY3 progressbar 11 | rpyc 12 | jinja2 13 | # There is a bug in requests 2.4.0 where it leaks urllib3 exceptions 14 | requests>=2.8.0,<3.0 15 | #Guessit requires python-dateutil<=2.5.2 16 | python-dateutil>=2.5.2 17 | jsonschema>=2.0 18 | path.py>=8.1.1 19 | pathlib>=1.0 20 | guessit<=2.0.4 21 | # Bug in apscheduler 3.1.0 https://github.com/agronholm/apscheduler/issues/121 22 | apscheduler>=3.0.3,!=3.1.0 23 | # WebUI Requirements 24 | cherrypy>=3.7.0 25 | flask>=0.7 26 | flask-restful>=0.3.3 27 | flask-restplus==0.8.6 28 | flask-compress>=1.2.1 29 | flask-login>=0.3.2 30 | flask-cors>=2.1.2 31 | pyparsing>=2.0.3 32 | Safe>=0.4 33 | future>=0.15.2 34 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/rustyrazorblade-machete-requirements.txt: -------------------------------------------------------------------------------- 1 | thunderdome==0.4.3 2 | Flask==0.9 3 | uwsgi==1.9.6 4 | ipython 5 | ipdb 6 | prettytable 7 | cython==0.19 8 | https://s3-us-west-2.amazonaws.com/graphplatform.swmirror/gevent-1.0rc2.zip 9 | statsd==1.0.0 10 | thunderdome-logging==1.0 11 | nose 12 | GitPython==0.3.2.RC1 13 | celery==3.0.17 14 | supervisor==3.0b1 15 | hiredis==0.1.1 16 | redis==2.7.2 17 | Flask-Classy==0.5.2 18 | passlib==1.6.1 19 | shovel==0.1.9 20 | Flask-Testing==0.4 21 | simplejson==3.1.3 22 | yolk==0.4.3 23 | configobj==4.7.2 24 | Markdown==2.3.1 25 | pyes==0.19.1 26 | Mako==0.8.0 27 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/rustyrazorblade-machete-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | thunderdome==0.4.3 2 | Flask==0.9 3 | uwsgi==1.9.6 4 | ipython 5 | ipdb 6 | prettytable 7 | cython==0.19 8 | https://s3-us-west-2.amazonaws.com/graphplatform.swmirror/gevent-1.0rc2.zip 9 | statsd==1.0.0 10 | thunderdome-logging==1.0 11 | nose 12 | GitPython==0.3.2.RC1 13 | celery==3.0.17 14 | supervisor==3.0b1 15 | hiredis==0.1.1 16 | redis==2.7.2 17 | Flask-Classy==0.5.2 18 | passlib==1.6.1 19 | shovel==0.1.9 20 | Flask-Testing==0.4 21 | simplejson==3.1.3 22 | yolk==0.4.3 23 | configobj==4.7.2 24 | Markdown==2.3.1 25 | pyes==0.19.1 26 | Mako==0.8.0 27 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/ryansb-bookmarkd-requirements.txt: -------------------------------------------------------------------------------- 1 | Click>=3.1 2 | CommonMark>=0.5.4 3 | ipython[notebook]>=2.2.0 4 | six>=1.8 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/ryansb-bookmarkd-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | Click>=3.1 2 | CommonMark>=0.5.4 3 | ipython[notebook]>=2.2.0 4 | six>=1.8 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/theatlantic-django-cache-machine-requirements.txt: -------------------------------------------------------------------------------- 1 | # These are the reqs to build docs and run tests. 2 | sphinx 3 | mock 4 | -e git://github.com/jbalogh/django-nose.git@6f060d49ee193a05734704820f3fea92ee1759d2#egg=django-nose 5 | -e svn+http://code.djangoproject.com/svn/django/trunk@12335#egg=Django 6 | python-memcached 7 | -e git://github.com/jbalogh/test-utils.git#egg=test-utils 8 | fabric 9 | jinja2 10 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/theatlantic-django-cache-machine-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # These are the reqs to build docs and run tests. 2 | sphinx 3 | mock 4 | --editable git://github.com/jbalogh/django-nose.git@6f060d49ee193a05734704820f3fea92ee1759d2#egg=django-nose 5 | --editable svn+http://code.djangoproject.com/svn/django/trunk@12335#egg=Django 6 | python-memcached 7 | --editable git://github.com/jbalogh/test-utils.git#egg=test-utils 8 | fabric 9 | jinja2 10 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/vladikoff-loop-server-loadtests-requirements.txt: -------------------------------------------------------------------------------- 1 | gevent 2 | git+git://github.com/mozilla-services/loads.git 3 | git+git://github.com/mozilla-services/requests-hawk.git 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/vladikoff-loop-server-loadtests-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | gevent 2 | git+git://github.com/mozilla-services/loads.git 3 | git+git://github.com/mozilla-services/requests-hawk.git 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/more-requirements/vladikoff-loop-server-loadtests-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "gevent", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "gevent" 12 | }, 13 | "link": null, 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": null, 22 | "is_wheel": false, 23 | "is_url": null, 24 | "is_vcs_url": null, 25 | "is_name_at_url": false, 26 | "is_local_path": null, 27 | "has_egg_fragment": false 28 | }, 29 | { 30 | "name": null, 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "git+git://github.com/mozilla-services/loads.git" 37 | }, 38 | "link": "git+git://github.com/mozilla-services/loads.git", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": null, 48 | "is_url": true, 49 | "is_vcs_url": true, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": false 53 | }, 54 | { 55 | "name": null, 56 | "specifier": [], 57 | "is_editable": false, 58 | "is_pinned": false, 59 | "requirement_line": { 60 | "line_number": 3, 61 | "line": "git+git://github.com/mozilla-services/requests-hawk.git" 62 | }, 63 | "link": "git+git://github.com/mozilla-services/requests-hawk.git", 64 | "marker": null, 65 | "install_options": [], 66 | "global_options": [], 67 | "hash_options": [], 68 | "is_constraint": false, 69 | "extras": [], 70 | "invalid_options": {}, 71 | "is_archive": false, 72 | "is_wheel": null, 73 | "is_url": true, 74 | "is_vcs_url": true, 75 | "is_name_at_url": false, 76 | "is_local_path": true, 77 | "has_egg_fragment": false 78 | } 79 | ], 80 | "invalid_lines": [], 81 | "comments": [] 82 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/reqfiles/supported_options2.txt: -------------------------------------------------------------------------------- 1 | # default is no constraints 2 | # We're not testing the format control logic here, just that the options are 3 | # accepted 4 | --no-binary fred 5 | --only-binary wilma 6 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/packaging-docs-examples.txt: -------------------------------------------------------------------------------- 1 | ################################################### 2 | # example from https://pip.pypa.io/en/stable/cli/pip_freeze/#examples 3 | pip 4 | setuptools 5 | wheel 6 | 7 | SomeProject 8 | SomeProject==1.4 9 | SomeProject>=1,<2 10 | SomeProject~=1.4.2 11 | 12 | # Requirements files 13 | -r requirements.txt 14 | 15 | # Installing from VCS 16 | -e git+https://git.repo/some_pkg.git#egg=SomeProject # from git 17 | -e hg+https://hg.repo/some_pkg#egg=SomeProject # from mercurial 18 | -e svn+svn://svn.repo/some_pkg/trunk/#egg=SomeProject # from svn 19 | -e git+https://git.repo/some_pkg.git@feature#egg=SomeProject # from a branch 20 | 21 | # Installing from other Indexes 22 | --index-url http://my.package.repo/simple/ 23 | SomeProject 24 | 25 | --extra-index-url http://my.package.repo/simple 26 | SomeProject 27 | 28 | # Installing from a local src tree 29 | -e path 30 | 31 | some/path 32 | 33 | # Installing from local archives 34 | ./downloads/SomeProject-1.0.4.tar.gz 35 | 36 | # Install from a local directory containing archives (and don't check PyPI) 37 | --no-index 38 | --find-links=file:///local/dir/ 39 | SomeProject 40 | 41 | --no-index 42 | --find-links=/local/dir/ 43 | SomeProject 44 | 45 | --no-index 46 | --find-links=relative/dir/ 47 | SomeProject 48 | 49 | 50 | # Installing from other sources 51 | --extra-index-url http://localhost:7777 52 | SomeProject 53 | 54 | 55 | # Installing Prereleases 56 | --pre SomeProject 57 | 58 | # this works on two lines: 59 | --pre 60 | SomeProject 61 | 62 | 63 | # Install setuptools extras. 64 | SomePackage[PDF] 65 | SomePackage[PDF]==3.0 66 | -e .[PDF] # editable project in current directory 67 | 68 | 69 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/packaging-docs-examples.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | ################################################### 2 | # example from https://pip.pypa.io/en/stable/cli/pip_freeze/#examples 3 | pip 4 | setuptools 5 | wheel 6 | 7 | SomeProject 8 | SomeProject==1.4 9 | SomeProject>=1,<2 10 | SomeProject~=1.4.2 11 | 12 | # Requirements files 13 | --requirement requirements.txt 14 | 15 | # Installing from VCS 16 | --editable git+https://git.repo/some_pkg.git#egg=SomeProject # from git 17 | --editable hg+https://hg.repo/some_pkg#egg=SomeProject # from mercurial 18 | --editable svn+svn://svn.repo/some_pkg/trunk/#egg=SomeProject # from svn 19 | --editable git+https://git.repo/some_pkg.git@feature#egg=SomeProject # from a branch 20 | 21 | # Installing from other Indexes 22 | --index-url http://my.package.repo/simple/ 23 | SomeProject 24 | 25 | --extra-index-url http://my.package.repo/simple 26 | SomeProject 27 | 28 | # Installing from a local src tree 29 | --editable path 30 | 31 | some/path 32 | 33 | # Installing from local archives 34 | ./downloads/SomeProject-1.0.4.tar.gz 35 | 36 | # Install from a local directory containing archives (and don't check PyPI) 37 | --no-index 38 | --find-links file:///local/dir/ 39 | SomeProject 40 | 41 | --no-index 42 | --find-links /local/dir/ 43 | SomeProject 44 | 45 | --no-index 46 | --find-links relative/dir/ 47 | SomeProject 48 | 49 | # Installing from other sources 50 | --extra-index-url http://localhost:7777 51 | SomeProject 52 | 53 | # Installing Prereleases 54 | # Incorrect and ignored trailing argument(s): SomeProject 55 | --pre 56 | 57 | # this works on two lines: 58 | --pre 59 | SomeProject 60 | 61 | # Install setuptools extras. 62 | SomePackage[pdf] 63 | SomePackage[pdf]==3.0 64 | --editable .[pdf] # editable project in current directory 65 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pep-508-examples.txt: -------------------------------------------------------------------------------- 1 | ################################################### 2 | # example from https://www.python.org/dev/peps/pep-0508/#complete-grammar test program 3 | 4 | A 5 | A.B-C_D 6 | aa 7 | name 8 | name<=1 9 | name>=3 10 | name>=3,<2 11 | name@http://foo.com 12 | name [fred,bar] @ http://foo.com ; python_version=='2.7' 13 | name[quux, strange];python_version<'2.7' and platform_version=='2' 14 | name; os_name=='a' or os_name=='b' 15 | # Should parse as (a and b) or c 16 | name; os_name=='a' and os_name=='b' or os_name=='c' 17 | # Overriding precedence -> a and (b or c) 18 | name; os_name=='a' and (os_name=='b' or os_name=='c') 19 | # should parse as a or (b and c) 20 | name; os_name=='a' or os_name=='b' and os_name=='c' 21 | # Overriding precedence -> (a or b) and c 22 | name; (os_name=='a' or os_name=='b') and os_name=='c' -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pep-508-examples.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | ################################################### 2 | # example from https://www.python.org/dev/peps/pep-0508/#complete-grammar test program 3 | 4 | A 5 | A.B-C_D 6 | aa 7 | name 8 | name<=1 9 | name>=3 10 | name<2,>=3 11 | name@http://foo.com 12 | name[bar,fred]@http://foo.com ; python_version == "2.7" 13 | name[quux,strange]; python_version < "2.7" and platform_version == "2" 14 | name; os_name == "a" or os_name == "b" 15 | # Should parse as (a and b) or c 16 | name; os_name == "a" and os_name == "b" or os_name == "c" 17 | # Overriding precedence -> a and (b or c) 18 | name; os_name == "a" and (os_name == "b" or os_name == "c") 19 | # should parse as a or (b and c) 20 | name; os_name == "a" or os_name == "b" and os_name == "c" 21 | # Overriding precedence -> (a or b) and c 22 | name; (os_name == "a" or os_name == "b") and os_name == "c" 23 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-docs-examples-vcs.txt: -------------------------------------------------------------------------------- 1 | # examples from 2 | # https://pip.pypa.io/en/stable/topics/vcs-support/#supported-vcs 3 | 4 | # Git 5 | git+ssh://git.example.com/MyProject#egg=MyProject 6 | git+file:///home/user/projects/MyProject#egg=MyProject 7 | git+https://git.example.com/MyProject#egg=MyProject 8 | 9 | # It is also possible to specify a "git ref" such as branch name, a commit hash or a tag name: 10 | git+https://git.example.com/MyProject.git@master#egg=MyProject 11 | git+https://git.example.com/MyProject.git@v1.0#egg=MyProject 12 | git+https://git.example.com/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 13 | git+https://git.example.com/MyProject.git@refs/pull/123/head#egg=MyProject 14 | 15 | #Mercurial 16 | hg+http://hg.myproject.org/MyProject#egg=MyProject 17 | hg+https://hg.myproject.org/MyProject#egg=MyProject 18 | hg+ssh://hg.myproject.org/MyProject#egg=MyProject 19 | hg+file:///home/user/projects/MyProject#egg=MyProject 20 | 21 | # It is also possible to specify a revision number, a revision hash, a tag name or a local branch name: 22 | hg+http://hg.example.com/MyProject@da39a3ee5e6b#egg=MyProject 23 | hg+http://hg.example.com/MyProject@2019#egg=MyProject 24 | hg+http://hg.example.com/MyProject@v1.0#egg=MyProject 25 | hg+http://hg.example.com/MyProject@special_feature#egg=MyProject 26 | 27 | # Subversion 28 | svn+https://svn.example.com/MyProject#egg=MyProject 29 | svn+ssh://svn.example.com/MyProject#egg=MyProject 30 | svn+ssh://user@svn.example.com/MyProject#egg=MyProject 31 | 32 | # You can also give specific revisions to an SVN URL, like so: 33 | -e svn+http://svn.example.com/svn/MyProject/trunk@2019#egg=MyProject 34 | -e svn+http://svn.example.com/svn/MyProject/trunk@{20080101}#egg=MyProject 35 | 36 | # Bazaar 37 | bzr+http://bzr.example.com/MyProject/trunk#egg=MyProject 38 | bzr+sftp://user@example.com/MyProject/trunk#egg=MyProject 39 | bzr+ssh://user@example.com/MyProject/trunk#egg=MyProject 40 | bzr+ftp://user@example.com/MyProject/trunk#egg=MyProject 41 | bzr+lp:MyProject#egg=MyProject 42 | 43 | # Tags or revisions can be installed like so: 44 | bzr+https://bzr.example.com/MyProject/trunk@2019#egg=MyProject 45 | bzr+http://bzr.example.com/MyProject/trunk@v1.0#egg=MyProject 46 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-docs-examples-vcs.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # examples from 2 | # https://pip.pypa.io/en/stable/topics/vcs-support/#supported-vcs 3 | 4 | # Git 5 | git+ssh://git.example.com/MyProject#egg=MyProject 6 | git+file:///home/user/projects/MyProject#egg=MyProject 7 | git+https://git.example.com/MyProject#egg=MyProject 8 | 9 | # It is also possible to specify a "git ref" such as branch name, a commit hash or a tag name: 10 | git+https://git.example.com/MyProject.git@master#egg=MyProject 11 | git+https://git.example.com/MyProject.git@v1.0#egg=MyProject 12 | git+https://git.example.com/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 13 | git+https://git.example.com/MyProject.git@refs/pull/123/head#egg=MyProject 14 | 15 | #Mercurial 16 | hg+http://hg.myproject.org/MyProject#egg=MyProject 17 | hg+https://hg.myproject.org/MyProject#egg=MyProject 18 | hg+ssh://hg.myproject.org/MyProject#egg=MyProject 19 | hg+file:///home/user/projects/MyProject#egg=MyProject 20 | 21 | # It is also possible to specify a revision number, a revision hash, a tag name or a local branch name: 22 | hg+http://hg.example.com/MyProject@da39a3ee5e6b#egg=MyProject 23 | hg+http://hg.example.com/MyProject@2019#egg=MyProject 24 | hg+http://hg.example.com/MyProject@v1.0#egg=MyProject 25 | hg+http://hg.example.com/MyProject@special_feature#egg=MyProject 26 | 27 | # Subversion 28 | svn+https://svn.example.com/MyProject#egg=MyProject 29 | svn+ssh://svn.example.com/MyProject#egg=MyProject 30 | svn+ssh://user@svn.example.com/MyProject#egg=MyProject 31 | 32 | # You can also give specific revisions to an SVN URL, like so: 33 | --editable svn+http://svn.example.com/svn/MyProject/trunk@2019#egg=MyProject 34 | --editable svn+http://svn.example.com/svn/MyProject/trunk@{20080101}#egg=MyProject 35 | 36 | # Bazaar 37 | bzr+http://bzr.example.com/MyProject/trunk#egg=MyProject 38 | bzr+sftp://user@example.com/MyProject/trunk#egg=MyProject 39 | bzr+ssh://user@example.com/MyProject/trunk#egg=MyProject 40 | bzr+ftp://user@example.com/MyProject/trunk#egg=MyProject 41 | bzr+lp:MyProject#egg=MyProject 42 | 43 | # Tags or revisions can be installed like so: 44 | bzr+https://bzr.example.com/MyProject/trunk@2019#egg=MyProject 45 | bzr+http://bzr.example.com/MyProject/trunk@v1.0#egg=MyProject 46 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-docs-examples2.txt: -------------------------------------------------------------------------------- 1 | # example from 2 | # https://pip.pypa.io/en/stable/reference/requirements-file-format/ 3 | 4 | ###### Requirements without Version Specifiers ###### 5 | pytest 6 | pytest-cov 7 | beautifulsoup4 8 | 9 | ###### Requirements with Version Specifiers ###### 10 | # See https://www.python.org/dev/peps/pep-0440/#version-specifiers 11 | docopt == 0.6.1 # Version Matching. Must be version 0.6.1 12 | keyring >= 4.1.1 # Minimum version 4.1.1 13 | coverage != 3.5 # Version Exclusion. Anything except version 3.5 14 | Mopidy-Dirble ~= 1.1 # Compatible release. Same as >= 1.1, == 1.* 15 | 16 | ###### Refer to other requirements files ###### 17 | -r other-requirements.txt 18 | 19 | ###### A particular file ###### 20 | ./downloads/numpy-1.9.2-cp34-none-win32.whl 21 | http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl 22 | 23 | ###### Additional Requirements without Version Specifiers ###### 24 | # Same as 1st section, just here to show that you can put things in any order. 25 | rejected 26 | green -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-docs-examples2.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # example from 2 | # https://pip.pypa.io/en/stable/reference/requirements-file-format/ 3 | 4 | ###### Requirements without Version Specifiers ###### 5 | pytest 6 | pytest-cov 7 | beautifulsoup4 8 | 9 | ###### Requirements with Version Specifiers ###### 10 | # See https://www.python.org/dev/peps/pep-0440/#version-specifiers 11 | docopt==0.6.1 # Version Matching. Must be version 0.6.1 12 | keyring>=4.1.1 # Minimum version 4.1.1 13 | coverage!=3.5 # Version Exclusion. Anything except version 3.5 14 | Mopidy-Dirble~=1.1 # Compatible release. Same as >= 1.1, == 1.* 15 | 16 | ###### Refer to other requirements files ###### 17 | --requirement other-requirements.txt 18 | 19 | ###### A particular file ###### 20 | ./downloads/numpy-1.9.2-cp34-none-win32.whl 21 | http://wxpython.org/Phoenix/snapshot-builds/wxPython_Phoenix-3.0.3.dev1820+49a8884-cp34-none-win_amd64.whl 22 | 23 | ###### Additional Requirements without Version Specifiers ###### 24 | # Same as 1st section, just here to show that you can put things in any order. 25 | rejected 26 | green 27 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-own-requirements.txt: -------------------------------------------------------------------------------- 1 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/docs/requirements.txt 2 | 3 | sphinx ~= 4.2 4 | towncrier 5 | furo 6 | myst_parser 7 | sphinx-copybutton 8 | sphinx-inline-tabs 9 | sphinxcontrib-towncrier >= 0.2.0a0 10 | 11 | # `docs.pipext` uses pip's internals to generate documentation. So, we install 12 | # the current directory to make it work. 13 | . 14 | 15 | 16 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/tests/requirements.txt 17 | 18 | cryptography 19 | freezegun 20 | pytest 21 | pytest-cov 22 | pytest-rerunfailures 23 | pytest-xdist 24 | scripttest 25 | setuptools 26 | virtualenv < 20.0 27 | werkzeug 28 | wheel 29 | tomli-w 30 | 31 | 32 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/tests/requirements-common_wheels.txt 33 | 34 | # Create local setuptools wheel files for testing by: 35 | # 1. Cloning setuptools and checking out the branch of interest 36 | # 2. Running `python3 bootstrap.py` in that directory 37 | # 3. Running `python3 -m pip wheel --no-cache -w /tmp/setuptools_build_meta_legacy/ .` 38 | # 4. Replacing the `setuptools` entry below with a `file:///...` URL 39 | # (Adjust artifact directory used based on preference and operating system) 40 | 41 | setuptools >= 40.8.0 42 | wheel 43 | # As required by pytest-cov. 44 | coverage >= 4.4 45 | 46 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/src/pip/_vendor/vendor.txt 47 | 48 | CacheControl==0.12.6 # Make sure to update the license in pyproject.toml for this. 49 | colorama==0.4.4 50 | distlib==0.3.3 51 | distro==1.6.0 52 | html5lib==1.1 53 | msgpack==1.0.2 54 | packaging==21.0 55 | pep517==0.12.0 56 | platformdirs==2.4.0 57 | progress==1.6 58 | pyparsing==2.4.7 59 | requests==2.26.0 60 | certifi==2021.05.30 61 | chardet==4.0.0 62 | idna==3.2 63 | urllib3==1.26.7 64 | rich==10.14.0 65 | pygments==2.10.0 66 | typing_extensions==3.10.0.2 67 | resolvelib==0.8.1 68 | setuptools==44.0.0 69 | six==1.16.0 70 | tenacity==8.0.1 71 | tomli==1.0.3 72 | webencodings==0.5.1 -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-own-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/docs/requirements.txt 2 | 3 | sphinx~=4.2 4 | towncrier 5 | furo 6 | myst_parser 7 | sphinx-copybutton 8 | sphinx-inline-tabs 9 | sphinxcontrib-towncrier>=0.2.0a0 10 | 11 | # `docs.pipext` uses pip's internals to generate documentation. So, we install 12 | # the current directory to make it work. 13 | . 14 | 15 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/tests/requirements.txt 16 | 17 | cryptography 18 | freezegun 19 | pytest 20 | pytest-cov 21 | pytest-rerunfailures 22 | pytest-xdist 23 | scripttest 24 | setuptools 25 | virtualenv<20.0 26 | werkzeug 27 | wheel 28 | tomli-w 29 | 30 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/tests/requirements-common_wheels.txt 31 | 32 | # Create local setuptools wheel files for testing by: 33 | # 1. Cloning setuptools and checking out the branch of interest 34 | # 2. Running `python3 bootstrap.py` in that directory 35 | # 3. Running `python3 -m pip wheel --no-cache -w /tmp/setuptools_build_meta_legacy/ .` 36 | # 4. Replacing the `setuptools` entry below with a `file:///...` URL 37 | # (Adjust artifact directory used based on preference and operating system) 38 | 39 | setuptools>=40.8.0 40 | wheel 41 | # As required by pytest-cov. 42 | coverage>=4.4 43 | 44 | # from https://github.com/pypa/pip/blob/914178b5b963dbbd9585b432617f91f4a8fce28c/src/pip/_vendor/vendor.txt 45 | 46 | CacheControl==0.12.6 # Make sure to update the license in pyproject.toml for this. 47 | colorama==0.4.4 48 | distlib==0.3.3 49 | distro==1.6.0 50 | html5lib==1.1 51 | msgpack==1.0.2 52 | packaging==21.0 53 | pep517==0.12.0 54 | platformdirs==2.4.0 55 | progress==1.6 56 | pyparsing==2.4.7 57 | requests==2.26.0 58 | certifi==2021.05.30 59 | chardet==4.0.0 60 | idna==3.2 61 | urllib3==1.26.7 62 | rich==10.14.0 63 | pygments==2.10.0 64 | typing_extensions==3.10.0.2 65 | resolvelib==0.8.1 66 | setuptools==44.0.0 67 | six==1.16.0 68 | tenacity==8.0.1 69 | tomli==1.0.3 70 | webencodings==0.5.1 71 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-upgrader-example.txt: -------------------------------------------------------------------------------- 1 | # from https://github.com/simion/pip-upgrader/blob/master/requirements/local.txt 2 | 3 | # this file is only used for testing the cli 4 | -r production.txt 5 | -r extra/debug.txt 6 | 7 | ipython==6.0.0 8 | 9 | # this kind of upgrade is not yet supported 10 | ipdb>=0.0.1 -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-upgrader-example.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # from https://github.com/simion/pip-upgrader/blob/master/requirements/local.txt 2 | 3 | # this file is only used for testing the cli 4 | --requirement production.txt 5 | --requirement extra/debug.txt 6 | 7 | ipython==6.0.0 8 | 9 | # this kind of upgrade is not yet supported 10 | ipdb>=0.0.1 11 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pip-upgrader-example.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [ 3 | { 4 | "line_number": 4, 5 | "line": "-r production.txt", 6 | "requirements": [ 7 | "production.txt" 8 | ] 9 | }, 10 | { 11 | "line_number": 5, 12 | "line": "-r extra/debug.txt", 13 | "requirements": [ 14 | "extra/debug.txt" 15 | ] 16 | } 17 | ], 18 | "requirements": [ 19 | { 20 | "name": "ipython", 21 | "specifier": [ 22 | "==6.0.0" 23 | ], 24 | "is_editable": false, 25 | "is_pinned": true, 26 | "requirement_line": { 27 | "line_number": 7, 28 | "line": "ipython==6.0.0" 29 | }, 30 | "link": null, 31 | "marker": null, 32 | "install_options": [], 33 | "global_options": [], 34 | "hash_options": [], 35 | "is_constraint": false, 36 | "extras": [], 37 | "invalid_options": {}, 38 | "is_archive": null, 39 | "is_wheel": false, 40 | "is_url": null, 41 | "is_vcs_url": null, 42 | "is_name_at_url": false, 43 | "is_local_path": null, 44 | "has_egg_fragment": false 45 | }, 46 | { 47 | "name": "ipdb", 48 | "specifier": [ 49 | ">=0.0.1" 50 | ], 51 | "is_editable": false, 52 | "is_pinned": false, 53 | "requirement_line": { 54 | "line_number": 10, 55 | "line": "ipdb>=0.0.1" 56 | }, 57 | "link": null, 58 | "marker": null, 59 | "install_options": [], 60 | "global_options": [], 61 | "hash_options": [], 62 | "is_constraint": false, 63 | "extras": [], 64 | "invalid_options": {}, 65 | "is_archive": null, 66 | "is_wheel": false, 67 | "is_url": null, 68 | "is_vcs_url": null, 69 | "is_name_at_url": false, 70 | "is_local_path": null, 71 | "has_egg_fragment": false 72 | } 73 | ], 74 | "invalid_lines": [], 75 | "comments": [ 76 | { 77 | "line_number": 1, 78 | "line": "# from https://github.com/simion/pip-upgrader/blob/master/requirements/local.txt" 79 | }, 80 | { 81 | "line_number": 3, 82 | "line": "# this file is only used for testing the cli" 83 | }, 84 | { 85 | "line_number": 9, 86 | "line": "# this kind of upgrade is not yet supported" 87 | } 88 | ] 89 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pipfile-requirements-tests.txt: -------------------------------------------------------------------------------- 1 | # from https://github.com/frostming/pipfile-requirements/blob/master/tests/ 2 | 3 | appnope==0.1.0; sys_platform == "darwin" 4 | pexpect==4.8.0; sys_platform != "win32" 5 | six==1.14.0 --hash=sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a --hash=sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c 6 | sqlalchemy==1.3.13 --hash=sha256:64a7b71846db6423807e96820993fa12a03b89127d278290ca25c0b11ed7b4fb 7 | flask-whooshee 8 | wtforms==2.2.1 9 | --index-url=https://pypi.org/simple 10 | --extra-index-url=https://pypi.example.com/simple 11 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pipfile-requirements-tests.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # from https://github.com/frostming/pipfile-requirements/blob/master/tests/ 2 | 3 | appnope==0.1.0; sys_platform == "darwin" 4 | pexpect==4.8.0; sys_platform != "win32" 5 | six==1.14.0 \ 6 | --hash=sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a \ 7 | --hash=sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c 8 | sqlalchemy==1.3.13 \ 9 | --hash=sha256:64a7b71846db6423807e96820993fa12a03b89127d278290ca25c0b11ed7b4fb 10 | flask-whooshee 11 | wtforms==2.2.1 12 | --index-url https://pypi.org/simple 13 | --extra-index-url https://pypi.example.com/simple 14 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pypi-oldest-requirements-tests.txt: -------------------------------------------------------------------------------- 1 | # from https://github.com/renefritze/pypi_oldest_requirements/blob/main/tests/ 2 | 3 | -r requirements.txt 4 | # This file is autogenerated. Edit dependencies.py instead 5 | PyQt5!=5.15.2,>5.7,!=5.15.2.*,!=5.15.4,!=5.15.3 6 | hypothesis[numpy,pytest]>=5.19 7 | myst-nb>=0.13.0a1 8 | pypi-oldest-requirements>=2021.1 9 | pytest>=4.4 10 | readme_renderer[md] 11 | 12 | -r requirements.txt 13 | -r requirements-ci.txt 14 | PySide2!=5.15.2,!=5.15.2.*,!=5.11.* 15 | bash_kernel 16 | deal 17 | cython>=0.28;python_version < "3.9" 18 | cython>=0.29.12;python_version >= "3.9" 19 | 20 | meshio==4.2.0 21 | mpi4py>=3.0.3;python_version >= "3.9" 22 | mpi4py>=3.0;python_version < "3.9" 23 | nbresuse 24 | numpy>=1.15.4;python_version == "3.7" 25 | numpy>=1.16.0;python_version != "3.6" and python_version != "3.7" and python_version != "3.8" and python_version != "3.9" 26 | numpy>=1.16.0;python_version == "3.6" 27 | numpy>=1.17.5;python_version == "3.8" 28 | numpy>=1.19.4;python_version == "3.9" 29 | 30 | scipy>=1.1;python_version < "3.8" 31 | scipy>=1.3.3;python_version == "3.8" 32 | scipy>=1.5.4;python_version >= "3.9" 33 | setuptools>=40.8.0,<49.2.0;python_version < "3.9" 34 | setuptools>=49.1,<49.2.0;python_version >= "3.9" 35 | slycot>=0.4.0 36 | sphinx-autoapi>=1.8 37 | 38 | scipy>=1.1;python_version < "3.8" 39 | scipy>=1.3.3;python_version == "3.8" 40 | scipy>=1.5.4;python_version >= "3.9" 41 | setuptools>=40.8.0,<49.2.0;python_version < "3.9" 42 | setuptools>=49.1,<49.2.0;python_version >= "3.9" -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/pypi-oldest-requirements-tests.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # from https://github.com/renefritze/pypi_oldest_requirements/blob/main/tests/ 2 | 3 | --requirement requirements.txt 4 | # This file is autogenerated. Edit dependencies.py instead 5 | PyQt5>5.7,!=5.15.2,!=5.15.2.*,!=5.15.3,!=5.15.4 6 | hypothesis[numpy,pytest]>=5.19 7 | myst-nb>=0.13.0a1 8 | pypi-oldest-requirements>=2021.1 9 | pytest>=4.4 10 | readme_renderer[md] 11 | 12 | --requirement requirements.txt 13 | --requirement requirements-ci.txt 14 | PySide2!=5.11.*,!=5.15.2,!=5.15.2.* 15 | bash_kernel 16 | deal 17 | cython>=0.28; python_version < "3.9" 18 | cython>=0.29.12; python_version >= "3.9" 19 | 20 | meshio==4.2.0 21 | mpi4py>=3.0.3; python_version >= "3.9" 22 | mpi4py>=3.0; python_version < "3.9" 23 | nbresuse 24 | numpy>=1.15.4; python_version == "3.7" 25 | numpy>=1.16.0; python_version != "3.6" and python_version != "3.7" and python_version != "3.8" and python_version != "3.9" 26 | numpy>=1.16.0; python_version == "3.6" 27 | numpy>=1.17.5; python_version == "3.8" 28 | numpy>=1.19.4; python_version == "3.9" 29 | 30 | scipy>=1.1; python_version < "3.8" 31 | scipy>=1.3.3; python_version == "3.8" 32 | scipy>=1.5.4; python_version >= "3.9" 33 | setuptools>=40.8.0,<49.2.0; python_version < "3.9" 34 | setuptools>=49.1,<49.2.0; python_version >= "3.9" 35 | slycot>=0.4.0 36 | sphinx-autoapi>=1.8 37 | 38 | scipy>=1.1; python_version < "3.8" 39 | scipy>=1.3.3; python_version == "3.8" 40 | scipy>=1.5.4; python_version >= "3.9" 41 | setuptools>=40.8.0,<49.2.0; python_version < "3.9" 42 | setuptools>=49.1,<49.2.0; python_version >= "3.9" 43 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/req-detector-requirements.txt: -------------------------------------------------------------------------------- 1 | # core framework 2 | uwsgi 3 | flask 4 | 5 | # flask extensions 6 | flask-mail 7 | flask-migrate 8 | flask-oauthlib 9 | flask-script 10 | flask-scrypt 11 | flask-weasyprint 12 | flask-sqlalchemy 13 | #flask-testing 14 | git+git://github.com/jarus/flask-testing.git 15 | flask-jwt 16 | flask-bouncer 17 | flask-restful 18 | flask-marshmallow 19 | flask-assets 20 | flask-collect 21 | awesome-slugify 22 | 23 | # testing 24 | #fake-factory 25 | https://github.com/traumtopf/faker/tarball/master 26 | surrealism 27 | freezegun 28 | selenium 29 | testtools 30 | 31 | # maybe extensions 32 | #restless 33 | #flash-babel 34 | #flask-restless 35 | #flask-assets 36 | #flask-cache 37 | #flask-classy 38 | #flask-debugtoolbar 39 | #flask-googlemaps 40 | #flask-gravatar 41 | #flask-jinjahelpers 42 | #flask-lesscss 43 | #flask-markdown 44 | #flask-moment 45 | #flask-principal 46 | #flask-restdoc 47 | #flask-runner 48 | #flask-user 49 | 50 | # other extensions 51 | #wtforms-alchemy 52 | #sqlalchemy-defaults 53 | #wtforms-components 54 | #wtforms-json 55 | 56 | # testing 57 | #coverage 58 | 59 | # correctness 60 | #pyflakes 61 | #pep8 62 | #flake8 63 | #pylint 64 | prospector 65 | 66 | # other stuff 67 | paypalrestsdk 68 | #outputty 69 | pycountry 70 | #certifi 71 | psycopg2 72 | #raven[flask] # client for sentry (a web application error logger) 73 | git+https://github.com/lazzrek/raven-python.git#egg=raven[flask] 74 | sadisplay==0.3.8dev 75 | isodate 76 | colour-runner 77 | requests 78 | pygeoip 79 | 80 | # webassets filters 81 | rjsmin 82 | cssmin -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/req-detector-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # core framework 2 | uwsgi 3 | flask 4 | 5 | # flask extensions 6 | flask-mail 7 | flask-migrate 8 | flask-oauthlib 9 | flask-script 10 | flask-scrypt 11 | flask-weasyprint 12 | flask-sqlalchemy 13 | #flask-testing 14 | git+git://github.com/jarus/flask-testing.git 15 | flask-jwt 16 | flask-bouncer 17 | flask-restful 18 | flask-marshmallow 19 | flask-assets 20 | flask-collect 21 | awesome-slugify 22 | 23 | # testing 24 | #fake-factory 25 | https://github.com/traumtopf/faker/tarball/master 26 | surrealism 27 | freezegun 28 | selenium 29 | testtools 30 | 31 | # maybe extensions 32 | #restless 33 | #flash-babel 34 | #flask-restless 35 | #flask-assets 36 | #flask-cache 37 | #flask-classy 38 | #flask-debugtoolbar 39 | #flask-googlemaps 40 | #flask-gravatar 41 | #flask-jinjahelpers 42 | #flask-lesscss 43 | #flask-markdown 44 | #flask-moment 45 | #flask-principal 46 | #flask-restdoc 47 | #flask-runner 48 | #flask-user 49 | 50 | # other extensions 51 | #wtforms-alchemy 52 | #sqlalchemy-defaults 53 | #wtforms-components 54 | #wtforms-json 55 | 56 | # testing 57 | #coverage 58 | 59 | # correctness 60 | #pyflakes 61 | #pep8 62 | #flake8 63 | #pylint 64 | prospector 65 | 66 | # other stuff 67 | paypalrestsdk 68 | #outputty 69 | pycountry 70 | #certifi 71 | psycopg2 72 | #raven[flask] # client for sentry (a web application error logger) 73 | git+https://github.com/lazzrek/raven-python.git#egg=raven[flask] 74 | sadisplay==0.3.8dev 75 | isodate 76 | colour-runner 77 | requests 78 | pygeoip 79 | 80 | # webassets filters 81 | rjsmin 82 | cssmin 83 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/serverless-python-requirements-tests.txt: -------------------------------------------------------------------------------- 1 | # examples from 2 | # https://github.com/serverless/serverless-python-requirements/blob/master/tests 3 | 4 | -e git+https://github.com/boto/boto3.git#egg=boto3 5 | 6 | python-dateutil==2.7.5 \ 7 | --hash=sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93 \ 8 | --hash=sha256:88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02 \ 9 | # via botocore 10 | s3transfer==0.1.13 \ 11 | --hash=sha256:90dc18e028989c609146e241ea153250be451e05ecc0c2832565231dacdf59c1 \ 12 | --hash=sha256:c7a9ec356982d5e9ab2d4b46391a7d6a950e2b04c472419f5fdec70cc0ada72f \ 13 | # via boto3 14 | six==1.11.0 \ 15 | --hash=sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9 \ 16 | --hash=sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb \ 17 | # via python-dateutil 18 | urllib3==1.24.2 \ 19 | --hash=sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0 \ 20 | --hash=sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3 \ 21 | # via botocore 22 | werkzeug==0.15.3 \ 23 | --hash=sha256:97660b282aa7e29f94f3fe378e5c7162d7ab9d601a8dbb1cbb2ffc8f0e54607d \ 24 | --hash=sha256:cfd1281b1748288e59762c0e174d64d8bcb2b70e7c57bc4a1203c8825af24ac3 \ 25 | # via flask 26 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/serverless-python-requirements-tests.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # examples from 2 | # https://github.com/serverless/serverless-python-requirements/blob/master/tests 3 | 4 | --editable git+https://github.com/boto/boto3.git#egg=boto3 5 | 6 | python-dateutil==2.7.5 \ 7 | --hash=sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93 \ 8 | --hash=sha256:88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02 # via botocore 9 | 10 | s3transfer==0.1.13 \ 11 | --hash=sha256:90dc18e028989c609146e241ea153250be451e05ecc0c2832565231dacdf59c1 \ 12 | --hash=sha256:c7a9ec356982d5e9ab2d4b46391a7d6a950e2b04c472419f5fdec70cc0ada72f # via boto3 13 | 14 | six==1.11.0 \ 15 | --hash=sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9 \ 16 | --hash=sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb # via python-dateutil 17 | 18 | urllib3==1.24.2 \ 19 | --hash=sha256:4c291ca23bbb55c76518905869ef34bdd5f0e46af7afe6861e8375643ffee1a0 \ 20 | --hash=sha256:9a247273df709c4fedb38c711e44292304f73f39ab01beda9f6b9fc375669ac3 # via botocore 21 | 22 | werkzeug==0.15.3 \ 23 | --hash=sha256:97660b282aa7e29f94f3fe378e5c7162d7ab9d601a8dbb1cbb2ffc8f0e54607d \ 24 | --hash=sha256:cfd1281b1748288e59762c0e174d64d8bcb2b70e7c57bc4a1203c8825af24ac3 # via flask 25 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/sort-requirements-tests.txt: -------------------------------------------------------------------------------- 1 | # from https://github.com/rehandalal/sort-requirements/blob/master/tests/fixtures/ 2 | 3 | -r other.txt 4 | 5 | apple==0.2 \ 6 | --hash=sha256:3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d \ 7 | --hash=sha256:2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6 \ 8 | # inline comment 9 | 10 | bottle==1.0 11 | apple!=0.2 12 | core~=3.1.1 13 | east>=1.0 14 | delta==2.0 -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/sort-requirements-tests.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # from https://github.com/rehandalal/sort-requirements/blob/master/tests/fixtures/ 2 | 3 | --requirement other.txt 4 | 5 | apple==0.2 \ 6 | --hash=sha256:3e23e8160039594a33894f6564e1b1348bbd7a0088d42c4acb73eeaed59c009d \ 7 | --hash=sha256:2e7d2c03a9507ae265ecf5b5356885a53393a2029d241394997265a1a25aefc6 # inline comment 8 | 9 | bottle==1.0 10 | apple!=0.2 11 | core~=3.1.1 12 | east>=1.0 13 | delta==2.0 14 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/supported_options2.txt: -------------------------------------------------------------------------------- 1 | # default is no constraints 2 | # We're not testing the format control logic here, just that the options are 3 | # accepted 4 | --no-binary fred 5 | --only-binary wilma 6 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/supported_options2.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # default is no constraints 2 | # We're not testing the format control logic here, just that the options are 3 | # accepted 4 | --no-binary fred 5 | --only-binary wilma 6 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/supported_options2.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [ 3 | { 4 | "line_number": 4, 5 | "line": "--no-binary fred", 6 | "no_binary": [ 7 | "fred" 8 | ] 9 | }, 10 | { 11 | "line_number": 5, 12 | "line": "--only-binary wilma", 13 | "only_binary": [ 14 | "wilma" 15 | ] 16 | } 17 | ], 18 | "requirements": [], 19 | "invalid_lines": [], 20 | "comments": [ 21 | { 22 | "line_number": 1, 23 | "line": "# default is no constraints" 24 | }, 25 | { 26 | "line_number": 2, 27 | "line": "# We're not testing the format control logic here, just that the options are" 28 | }, 29 | { 30 | "line_number": 3, 31 | "line": "# accepted" 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/unsupported_options.txt: -------------------------------------------------------------------------------- 1 | # from https://github.com/pypa/pip/blob/49e9ac1a86ac2ee5174ca9c8f87b4cbf4fcbcca9/tests/data/reqfiles/supported_options.txt 2 | # requirement file containing various unsupported and legacy options 3 | # legacy 4 | --no-use-wheel 5 | 6 | # unknown 7 | --unknown-options 8 | 9 | # trailing arugment 10 | --index-url https://foo.com some trailing junk 11 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/unsupported_options.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # from https://github.com/pypa/pip/blob/49e9ac1a86ac2ee5174ca9c8f87b4cbf4fcbcca9/tests/data/reqfiles/supported_options.txt 2 | # requirement file containing various unsupported and legacy options 3 | # legacy 4 | # Unsupported, legacy option: --no-use-wheel 5 | --no-use-wheel 6 | 7 | # unknown 8 | # pip_requirements_parser: error: no such option: --unknown-options 9 | --unknown-options 10 | 11 | # trailing arugment 12 | # Incorrect and ignored trailing argument(s): some, trailing, junk 13 | --index-url https://foo.com 14 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/requirements/unsupported_options.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [ 3 | { 4 | "line_number": 4, 5 | "line": "--no-use-wheel", 6 | "no_use_wheel": true 7 | }, 8 | { 9 | "line_number": 10, 10 | "line": "--index-url https://foo.com some trailing junk", 11 | "index_url": "https://foo.com" 12 | } 13 | ], 14 | "requirements": [], 15 | "invalid_lines": [ 16 | { 17 | "line_number": 4, 18 | "line": "--no-use-wheel", 19 | "error_message": "Unsupported, legacy option: --no-use-wheel" 20 | }, 21 | { 22 | "line_number": 7, 23 | "line": "--unknown-options", 24 | "error_message": "pip_requirements_parser: error: no such option: --unknown-options" 25 | }, 26 | { 27 | "line_number": 10, 28 | "line": "--index-url https://foo.com some trailing junk", 29 | "error_message": "Incorrect and ignored trailing argument(s): some, trailing, junk" 30 | } 31 | ], 32 | "comments": [ 33 | { 34 | "line_number": 1, 35 | "line": "# from https://github.com/pypa/pip/blob/49e9ac1a86ac2ee5174ca9c8f87b4cbf4fcbcca9/tests/data/reqfiles/supported_options.txt" 36 | }, 37 | { 38 | "line_number": 2, 39 | "line": "# requirement file containing various unsupported and legacy options" 40 | }, 41 | { 42 | "line_number": 3, 43 | "line": "# legacy" 44 | }, 45 | { 46 | "line_number": 6, 47 | "line": "# unknown" 48 | }, 49 | { 50 | "line_number": 9, 51 | "line": "# trailing arugment" 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/basic-requirements.txt: -------------------------------------------------------------------------------- 1 | setuptools>=32.0.0 2 | nose>=1.3.7 3 | chardet>=3.0.4 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/basic-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | setuptools>=32.0.0 2 | nose>=1.3.7 3 | chardet>=3.0.4 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/basic-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "setuptools", 6 | "specifier": [ 7 | ">=32.0.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": false, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "setuptools>=32.0.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | }, 31 | { 32 | "name": "nose", 33 | "specifier": [ 34 | ">=1.3.7" 35 | ], 36 | "is_editable": false, 37 | "is_pinned": false, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "nose>=1.3.7" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [], 49 | "invalid_options": {}, 50 | "is_archive": null, 51 | "is_wheel": false, 52 | "is_url": null, 53 | "is_vcs_url": null, 54 | "is_name_at_url": false, 55 | "is_local_path": null, 56 | "has_egg_fragment": false 57 | }, 58 | { 59 | "name": "chardet", 60 | "specifier": [ 61 | ">=3.0.4" 62 | ], 63 | "is_editable": false, 64 | "is_pinned": false, 65 | "requirement_line": { 66 | "line_number": 3, 67 | "line": "chardet>=3.0.4" 68 | }, 69 | "link": null, 70 | "marker": null, 71 | "install_options": [], 72 | "global_options": [], 73 | "hash_options": [], 74 | "is_constraint": false, 75 | "extras": [], 76 | "invalid_options": {}, 77 | "is_archive": null, 78 | "is_wheel": false, 79 | "is_url": null, 80 | "is_vcs_url": null, 81 | "is_name_at_url": false, 82 | "is_local_path": null, 83 | "has_egg_fragment": false 84 | } 85 | ], 86 | "invalid_lines": [], 87 | "comments": [] 88 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/comments_and_empties-requirements.txt: -------------------------------------------------------------------------------- 1 | # Pypi ftw. 2 | Distutils2==1.0a3 3 | 4 | 5 | # Pegged git requirements 6 | git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack 7 | 8 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/comments_and_empties-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # Pypi ftw. 2 | Distutils2==1.0a3 3 | 4 | # Pegged git requirements 5 | git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack 6 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/comments_and_empties-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "Distutils2", 6 | "specifier": [ 7 | "==1.0a3" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 2, 13 | "line": "Distutils2==1.0a3" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | }, 31 | { 32 | "name": "django_haystack", 33 | "specifier": [], 34 | "is_editable": false, 35 | "is_pinned": false, 36 | "requirement_line": { 37 | "line_number": 6, 38 | "line": "git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack" 39 | }, 40 | "link": "git+git://github.com/toastdriven/django-haystack@259274e4127f723d76b893c87a82777f9490b960#egg=django_haystack", 41 | "marker": null, 42 | "install_options": [], 43 | "global_options": [], 44 | "hash_options": [], 45 | "is_constraint": false, 46 | "extras": [], 47 | "invalid_options": {}, 48 | "is_archive": false, 49 | "is_wheel": false, 50 | "is_url": true, 51 | "is_vcs_url": true, 52 | "is_name_at_url": false, 53 | "is_local_path": true, 54 | "has_egg_fragment": true 55 | } 56 | ], 57 | "invalid_lines": [], 58 | "comments": [ 59 | { 60 | "line_number": 1, 61 | "line": "# Pypi ftw." 62 | }, 63 | { 64 | "line_number": 5, 65 | "line": "# Pegged git requirements" 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/complex-requirements.txt: -------------------------------------------------------------------------------- 1 | --extra-index-url=http://dist.pinaxproject.com/dev/ 2 | 3 | Babel==0.9.6 4 | -e git+https://github.com/crateio/crate.web.git#egg=crate.web 5 | django-uuidfield==0.2 6 | -e git+https://github.com/dstufft/jutils.git#egg=jutils 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/complex-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --extra-index-url http://dist.pinaxproject.com/dev/ 2 | 3 | Babel==0.9.6 4 | --editable git+https://github.com/crateio/crate.web.git#egg=crate.web 5 | django-uuidfield==0.2 6 | --editable git+https://github.com/dstufft/jutils.git#egg=jutils 7 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/dev-requirements-dev.txt: -------------------------------------------------------------------------------- 1 | prompt_toolkit>=1.0.14 2 | Pygments==2.2.0 3 | regex 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/dev-requirements-dev.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | prompt_toolkit>=1.0.14 2 | Pygments==2.2.0 3 | regex 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/dev-requirements-dev.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "prompt_toolkit", 6 | "specifier": [ 7 | ">=1.0.14" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": false, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "prompt_toolkit>=1.0.14" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | }, 31 | { 32 | "name": "Pygments", 33 | "specifier": [ 34 | "==2.2.0" 35 | ], 36 | "is_editable": false, 37 | "is_pinned": true, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "Pygments==2.2.0" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [], 49 | "invalid_options": {}, 50 | "is_archive": null, 51 | "is_wheel": false, 52 | "is_url": null, 53 | "is_vcs_url": null, 54 | "is_name_at_url": false, 55 | "is_local_path": null, 56 | "has_egg_fragment": false 57 | }, 58 | { 59 | "name": "regex", 60 | "specifier": [], 61 | "is_editable": false, 62 | "is_pinned": false, 63 | "requirement_line": { 64 | "line_number": 3, 65 | "line": "regex" 66 | }, 67 | "link": null, 68 | "marker": null, 69 | "install_options": [], 70 | "global_options": [], 71 | "hash_options": [], 72 | "is_constraint": false, 73 | "extras": [], 74 | "invalid_options": {}, 75 | "is_archive": null, 76 | "is_wheel": false, 77 | "is_url": null, 78 | "is_vcs_url": null, 79 | "is_name_at_url": false, 80 | "is_local_path": null, 81 | "has_egg_fragment": false 82 | } 83 | ], 84 | "invalid_lines": [], 85 | "comments": [] 86 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/double_extras-requirements.txt: -------------------------------------------------------------------------------- 1 | MyPackage[PDF]==3.0 2 | Fizzy [foo, bar] 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/double_extras-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | MyPackage[pdf]==3.0 2 | Fizzy[bar,foo] 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/double_extras-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "MyPackage", 6 | "specifier": [ 7 | "==3.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "MyPackage[PDF]==3.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [ 22 | "pdf" 23 | ], 24 | "invalid_options": {}, 25 | "is_archive": null, 26 | "is_wheel": false, 27 | "is_url": null, 28 | "is_vcs_url": null, 29 | "is_name_at_url": false, 30 | "is_local_path": null, 31 | "has_egg_fragment": false 32 | }, 33 | { 34 | "name": "Fizzy", 35 | "specifier": [], 36 | "is_editable": false, 37 | "is_pinned": false, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "Fizzy [foo, bar]" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [ 49 | "bar", 50 | "foo" 51 | ], 52 | "invalid_options": {}, 53 | "is_archive": null, 54 | "is_wheel": false, 55 | "is_url": null, 56 | "is_vcs_url": null, 57 | "is_name_at_url": false, 58 | "is_local_path": null, 59 | "has_egg_fragment": false 60 | } 61 | ], 62 | "invalid_lines": [], 63 | "comments": [] 64 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/editable-requirements.txt: -------------------------------------------------------------------------------- 1 | -e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject 2 | --editable git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 3 | --editable hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject 4 | -e bzr+lp://MyProject#egg=MyProject 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/editable-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject 2 | --editable git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 3 | --editable hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject 4 | --editable bzr+lp://MyProject#egg=MyProject 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/eol_comment-requirements.txt: -------------------------------------------------------------------------------- 1 | req==1.0 # comment 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/eol_comment-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | req==1.0 # comment 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/eol_comment-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "req", 6 | "specifier": [ 7 | "==1.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "req==1.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | } 31 | ], 32 | "invalid_lines": [], 33 | "comments": [ 34 | { 35 | "line_number": 1, 36 | "line": "# comment" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt: -------------------------------------------------------------------------------- 1 | test>>1.2.0 2 | test=>1.2.0 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | # Invalid requirement: : Expected end or semicolon (after name and no valid version specifier) 2 | test>>1.2.0 3 | ^ 4 | test>>1.2.0 5 | # Invalid requirement: : Expected end or semicolon (after name and no valid version specifier) 6 | test=>1.2.0 7 | ^ 8 | test=>1.2.0 9 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/invalid_spec-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [], 4 | "invalid_lines": [ 5 | { 6 | "line_number": 1, 7 | "line": "test>>1.2.0", 8 | "error_message": "Invalid requirement: : Expected end or semicolon (after name and no valid version specifier)\n test>>1.2.0\n ^" 9 | }, 10 | { 11 | "line_number": 2, 12 | "line": "test=>1.2.0", 13 | "error_message": "Invalid requirement: : Expected end or semicolon (after name and no valid version specifier)\n test=>1.2.0\n ^" 14 | } 15 | ], 16 | "comments": [] 17 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/local_paths_and_files-requirements.txt: -------------------------------------------------------------------------------- 1 | file:///path/to/your/lib/project#egg=MyProject 2 | file://../../lib/project#egg=MyProject 3 | path/to/SomeProject#egg=SomeOtherProject 4 | -e path/to/AnotherProject#egg=AnotherProject 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/local_paths_and_files-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | file:///path/to/your/lib/project#egg=MyProject 2 | /../lib/project 3 | path/to/SomeProject#egg=SomeOtherProject 4 | --editable path/to/AnotherProject#egg=AnotherProject 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/many_specs-requirements.txt: -------------------------------------------------------------------------------- 1 | PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/many_specs-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/many_specs-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "PickyThing", 6 | "specifier": [ 7 | "<1.6", 8 | ">1.9", 9 | "!=1.9.6", 10 | "<2.0a0", 11 | "==2.4c1" 12 | ], 13 | "is_editable": false, 14 | "is_pinned": false, 15 | "requirement_line": { 16 | "line_number": 1, 17 | "line": "PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1" 18 | }, 19 | "link": null, 20 | "marker": null, 21 | "install_options": [], 22 | "global_options": [], 23 | "hash_options": [], 24 | "is_constraint": false, 25 | "extras": [], 26 | "invalid_options": {}, 27 | "is_archive": null, 28 | "is_wheel": false, 29 | "is_url": null, 30 | "is_vcs_url": null, 31 | "is_name_at_url": false, 32 | "is_local_path": null, 33 | "has_egg_fragment": false 34 | } 35 | ], 36 | "invalid_lines": [], 37 | "comments": [] 38 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/mixed-requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+https://github.com/davidfischer/requirements-parser.git#egg=requirements 2 | Django >=1.5, <1.6 3 | numpy 4 | DocParser [PDF] 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/mixed-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable git+https://github.com/davidfischer/requirements-parser.git#egg=requirements 2 | Django>=1.5,<1.6 3 | numpy 4 | DocParser[pdf] 5 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/pinned-sample-requirements.txt: -------------------------------------------------------------------------------- 1 | aiohttp==3.6.2 2 | async-timeout==3.0.1 3 | attrs==19.3.0 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/pinned-sample-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | aiohttp==3.6.2 2 | async-timeout==3.0.1 3 | attrs==19.3.0 4 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/pinned-sample-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "aiohttp", 6 | "specifier": [ 7 | "==3.6.2" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "aiohttp==3.6.2" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | }, 31 | { 32 | "name": "async-timeout", 33 | "specifier": [ 34 | "==3.0.1" 35 | ], 36 | "is_editable": false, 37 | "is_pinned": true, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "async-timeout==3.0.1" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [], 49 | "invalid_options": {}, 50 | "is_archive": null, 51 | "is_wheel": false, 52 | "is_url": null, 53 | "is_vcs_url": null, 54 | "is_name_at_url": false, 55 | "is_local_path": null, 56 | "has_egg_fragment": false 57 | }, 58 | { 59 | "name": "attrs", 60 | "specifier": [ 61 | "==19.3.0" 62 | ], 63 | "is_editable": false, 64 | "is_pinned": true, 65 | "requirement_line": { 66 | "line_number": 3, 67 | "line": "attrs==19.3.0" 68 | }, 69 | "link": null, 70 | "marker": null, 71 | "install_options": [], 72 | "global_options": [], 73 | "hash_options": [], 74 | "is_constraint": false, 75 | "extras": [], 76 | "invalid_options": {}, 77 | "is_archive": null, 78 | "is_wheel": false, 79 | "is_url": null, 80 | "is_vcs_url": null, 81 | "is_name_at_url": false, 82 | "is_local_path": null, 83 | "has_egg_fragment": false 84 | } 85 | ], 86 | "invalid_lines": [], 87 | "comments": [] 88 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/repeated-requirements.txt: -------------------------------------------------------------------------------- 1 | test==1.2.0 2 | test>=1.2.0 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/repeated-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | test==1.2.0 2 | test>=1.2.0 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/repeated-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "test", 6 | "specifier": [ 7 | "==1.2.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "test==1.2.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | }, 31 | { 32 | "name": "test", 33 | "specifier": [ 34 | ">=1.2.0" 35 | ], 36 | "is_editable": false, 37 | "is_pinned": false, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "test>=1.2.0" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [], 49 | "invalid_options": {}, 50 | "is_archive": null, 51 | "is_wheel": false, 52 | "is_url": null, 53 | "is_vcs_url": null, 54 | "is_name_at_url": false, 55 | "is_local_path": null, 56 | "has_egg_fragment": false 57 | } 58 | ], 59 | "invalid_lines": [], 60 | "comments": [] 61 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/simple-requirements.txt: -------------------------------------------------------------------------------- 1 | lxml==3.4.4 2 | requests==2.7.0 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/simple-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | lxml==3.4.4 2 | requests==2.7.0 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/simple-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "lxml", 6 | "specifier": [ 7 | "==3.4.4" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "lxml==3.4.4" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | }, 31 | { 32 | "name": "requests", 33 | "specifier": [ 34 | "==2.7.0" 35 | ], 36 | "is_editable": false, 37 | "is_pinned": true, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "requests==2.7.0" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [], 49 | "invalid_options": {}, 50 | "is_archive": null, 51 | "is_wheel": false, 52 | "is_url": null, 53 | "is_vcs_url": null, 54 | "is_name_at_url": false, 55 | "is_local_path": null, 56 | "has_egg_fragment": false 57 | } 58 | ], 59 | "invalid_lines": [], 60 | "comments": [] 61 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/urls_wth_checksums-requirements.txt: -------------------------------------------------------------------------------- 1 | http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97 2 | http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/urls_wth_checksums-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97 2 | http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/urls_wth_checksums-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": null, 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97" 12 | }, 13 | "link": "http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": null, 23 | "is_url": true, 24 | "is_vcs_url": false, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": false 28 | }, 29 | { 30 | "name": "Flask", 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask" 37 | }, 38 | "link": "http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": false, 48 | "is_url": true, 49 | "is_vcs_url": false, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": false 53 | } 54 | ], 55 | "invalid_lines": [], 56 | "comments": [] 57 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs-git-requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+git://git.myproject.org/MyProject#egg=MyProject 2 | -e git+https://git.myproject.org/MyProject#egg=MyProject 3 | -e git+ssh://git.myproject.org/MyProject#egg=MyProject 4 | -e git+ssh://git@git.myproject.org/MyProject#egg=MyProject 5 | -e git://git.myproject.org/MyProject.git@master#egg=MyProject 6 | -e git://git.myproject.org/MyProject.git@v1.0#egg=MyProject 7 | -e git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 8 | 9 | git+git://git.myproject.org/MyProject#egg=MyProject 10 | git+https://git.myproject.org/MyProject#egg=MyProject 11 | git+ssh://git.myproject.org/MyProject#egg=MyProject 12 | git://git.myproject.org/MyProject.git@master#egg=MyProject 13 | git://git.myproject.org/MyProject.git@v1.0#egg=MyProject 14 | git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 15 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs-git-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable git+git://git.myproject.org/MyProject#egg=MyProject 2 | --editable git+https://git.myproject.org/MyProject#egg=MyProject 3 | --editable git+ssh://git.myproject.org/MyProject#egg=MyProject 4 | --editable git+ssh://git@git.myproject.org/MyProject#egg=MyProject 5 | --editable git://git.myproject.org/MyProject.git@master#egg=MyProject 6 | --editable git://git.myproject.org/MyProject.git@v1.0#egg=MyProject 7 | --editable git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 8 | 9 | git+git://git.myproject.org/MyProject#egg=MyProject 10 | git+https://git.myproject.org/MyProject#egg=MyProject 11 | git+ssh://git.myproject.org/MyProject#egg=MyProject 12 | git://git.myproject.org/MyProject.git@master#egg=MyProject 13 | git://git.myproject.org/MyProject.git@v1.0#egg=MyProject 14 | git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 15 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_editable-requirements.txt: -------------------------------------------------------------------------------- 1 | -e bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject 2 | -e bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject 3 | -e bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject 4 | -e bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject 5 | -e bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject 6 | -e bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject 7 | 8 | bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject 9 | bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject 10 | bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject 11 | bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject 12 | bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject 13 | bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject 14 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_editable-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | --editable bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject 2 | --editable bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject 3 | --editable bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject 4 | --editable bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject 5 | --editable bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject 6 | --editable bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject 7 | 8 | bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject 9 | bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject 10 | bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject 11 | bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject 12 | bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject 13 | bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject 14 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_eggs-requirements.txt: -------------------------------------------------------------------------------- 1 | novcs+http://example.com#egg=a 2 | svn+http://example.com#egg 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_eggs-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | novcs+http://example.com#egg=a 2 | svn+http://example.com#egg 3 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_eggs-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "a", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "novcs+http://example.com#egg=a" 12 | }, 13 | "link": "novcs+http://example.com#egg=a", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": false, 23 | "is_url": false, 24 | "is_vcs_url": false, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": true 28 | }, 29 | { 30 | "name": null, 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "svn+http://example.com#egg" 37 | }, 38 | "link": "svn+http://example.com#egg", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": null, 48 | "is_url": true, 49 | "is_vcs_url": true, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": true 53 | } 54 | ], 55 | "invalid_lines": [], 56 | "comments": [] 57 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_extras_require-requirements.txt: -------------------------------------------------------------------------------- 1 | git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security] 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_extras_require-requirements.txt-expected.dumps: -------------------------------------------------------------------------------- 1 | git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security] 2 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/data/sc-requirements/vcs_extras_require-requirements.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "MyProject", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security]" 12 | }, 13 | "link": "git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security]", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [ 20 | "security" 21 | ], 22 | "invalid_options": {}, 23 | "is_archive": false, 24 | "is_wheel": false, 25 | "is_url": true, 26 | "is_vcs_url": true, 27 | "is_name_at_url": false, 28 | "is_local_path": true, 29 | "has_egg_fragment": true 30 | } 31 | ], 32 | "invalid_lines": [], 33 | "comments": [] 34 | } -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/test_requirements_file.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) nexB Inc. 3 | # SPDX-License-Identifier: MIT 4 | 5 | import json 6 | 7 | import pytest 8 | 9 | import pip_requirements_parser 10 | 11 | from pip_requirements_parser_tests.lib import ALL_REQFILES 12 | from pip_requirements_parser_tests.lib import MORE_REQFILES 13 | from pip_requirements_parser_tests.lib import SC_REQFILES 14 | 15 | """ 16 | Parse many requirements files and verify the expected JSON output 17 | """ 18 | 19 | all_test_requirements_files = ALL_REQFILES + MORE_REQFILES + SC_REQFILES 20 | 21 | 22 | @pytest.mark.parametrize("test_file", all_test_requirements_files) 23 | def test_RequirementsFile_to_dict( 24 | test_file: str, 25 | regen=False, 26 | ) -> None: 27 | 28 | expected_file = test_file + "-expected.json" 29 | results = pip_requirements_parser.RequirementsFile.from_file(test_file).to_dict() 30 | if regen: 31 | with open (expected_file, 'w') as outp: 32 | json.dump(results, outp, indent=2) 33 | expected = results 34 | else: 35 | with open (expected_file) as inp: 36 | expected = json.load(inp) 37 | 38 | assert results == expected 39 | 40 | 41 | @pytest.mark.parametrize("test_file", all_test_requirements_files) 42 | def test_RequirementsFile_dumps_unparse( 43 | test_file: str, 44 | regen=False, 45 | ) -> None: 46 | 47 | dumped = pip_requirements_parser.RequirementsFile.from_file(test_file).dumps( 48 | preserve_one_empty_line=True, 49 | ) 50 | 51 | expected_file = test_file + "-expected.dumps" 52 | 53 | if regen: 54 | with open(expected_file, "w") as out: 55 | out.write(dumped) 56 | expected = dumped 57 | else: 58 | with open(expected_file) as inp: 59 | expected = inp.read() 60 | 61 | assert dumped == expected 62 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/unit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aboutcode-org/pip-requirements-parser/4d18bc186553ca6ce619049dfdd63d4100f504a3/tests/pip_requirements_parser_tests/unit/__init__.py -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/unit/misc.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) The pip developers (see AUTHORS.txt file) 3 | # SPDX-License-Identifier: MIT 4 | 5 | # The following comment should be removed at some point in the future. 6 | # mypy: strict-optional=False 7 | 8 | import errno 9 | import logging 10 | import os 11 | import shutil 12 | import stat 13 | from types import TracebackType 14 | from typing import ( 15 | Any, 16 | Callable, 17 | Optional, 18 | Tuple, 19 | Type, 20 | TypeVar, 21 | ) 22 | 23 | 24 | logger = logging.getLogger(__name__) 25 | 26 | T = TypeVar("T") 27 | ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] 28 | VersionInfo = Tuple[int, int, int] 29 | NetlocTuple = Tuple[str, Tuple[Optional[str], Optional[str]]] 30 | 31 | 32 | def ensure_dir(path: str) -> None: 33 | """os.path.makedirs without EEXIST.""" 34 | try: 35 | os.makedirs(path) 36 | except OSError as e: 37 | # Windows can raise spurious ENOTEMPTY errors. See #6426. 38 | if e.errno != errno.EEXIST and e.errno != errno.ENOTEMPTY: 39 | raise 40 | 41 | 42 | def rmtree(directory: str, ignore_errors: bool = False) -> None: 43 | shutil.rmtree(directory, ignore_errors=ignore_errors, onerror=rmtree_errorhandler) 44 | 45 | 46 | def rmtree_errorhandler(func: Callable[..., Any], path: str, exc_info: ExcInfo) -> None: 47 | """On Windows, the files in .svn are read-only, so when rmtree() tries to 48 | remove them, an exception is thrown. We catch that here, remove the 49 | read-only attribute, and hopefully continue without problems.""" 50 | try: 51 | has_attr_readonly = not (os.stat(path).st_mode & stat.S_IWRITE) 52 | except OSError: 53 | # it's equivalent to os.path.exists 54 | return 55 | 56 | if has_attr_readonly: 57 | # convert to read/write 58 | os.chmod(path, stat.S_IWRITE) 59 | # use the original function to repeat the operation 60 | func(path) 61 | return 62 | else: 63 | raise 64 | 65 | 66 | # Simulates an enum 67 | def enum(*sequential: Any, **named: Any) -> Type[Any]: 68 | enums = dict(zip(sequential, range(len(sequential))), **named) 69 | reverse = {value: key for key, value in enums.items()} 70 | enums["reverse_mapping"] = reverse 71 | return type("Enum", (), enums) 72 | 73 | -------------------------------------------------------------------------------- /tests/pip_requirements_parser_tests/unit/test_urls.py: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) The pip developers (see AUTHORS.txt file) 3 | # SPDX-License-Identifier: MIT 4 | 5 | import sys 6 | from typing import Optional 7 | 8 | import pytest 9 | 10 | from pip_requirements_parser import get_url_scheme, url_to_path 11 | 12 | 13 | @pytest.mark.parametrize( 14 | "url,expected", 15 | [ 16 | ("http://localhost:8080/", "http"), 17 | ("file:c:/path/to/file", "file"), 18 | ("file:/dev/null", "file"), 19 | ("", None), 20 | ], 21 | ) 22 | def test_get_url_scheme(url: str, expected: Optional[str]) -> None: 23 | assert get_url_scheme(url) == expected 24 | 25 | 26 | @pytest.mark.parametrize( 27 | "url,win_expected,non_win_expected", 28 | [ 29 | ("file:tmp", "tmp", "tmp"), 30 | ("file:c:/path/to/file", r"C:\path\to\file", "c:/path/to/file"), 31 | ("file:/path/to/file", r"\path\to\file", "/path/to/file"), 32 | ("file://localhost/tmp/file", r"\tmp\file", "/tmp/file"), 33 | ("file://localhost/c:/tmp/file", r"C:\tmp\file", "/c:/tmp/file"), 34 | ("file://somehost/tmp/file", r"\\somehost\tmp\file", None), 35 | ("file:///tmp/file", r"\tmp\file", "/tmp/file"), 36 | ("file:///c:/tmp/file", r"C:\tmp\file", "/c:/tmp/file"), 37 | ], 38 | ) 39 | def test_url_to_path(url: str, win_expected: str, non_win_expected: str) -> None: 40 | if sys.platform == "win32": 41 | expected_path = win_expected 42 | else: 43 | expected_path = non_win_expected 44 | 45 | if expected_path is None: 46 | with pytest.raises(ValueError): 47 | url_to_path(url) 48 | else: 49 | assert url_to_path(url) == expected_path 50 | -------------------------------------------------------------------------------- /tests/requirements_detector/test1/requirements.txt: -------------------------------------------------------------------------------- 1 | -i https://example.com/custom/pypi 2 | Django>=1.5.0 3 | South==0.8.2 4 | amqp!=1.0.13 5 | # we want six too 6 | six<1.4,>=1.3.0 -------------------------------------------------------------------------------- /tests/requirements_detector/test2/requirements/base.txt: -------------------------------------------------------------------------------- 1 | amqp==1.0.13 2 | anyjson==0.3.3 3 | -------------------------------------------------------------------------------- /tests/requirements_detector/test2/requirements/webui.pip: -------------------------------------------------------------------------------- 1 | Django==1.5.2 2 | South==0.8.2 -------------------------------------------------------------------------------- /tests/requirements_detector/test3/pip_requirements.txt: -------------------------------------------------------------------------------- 1 | anyjson==0.3.3 2 | -------------------------------------------------------------------------------- /tests/requirements_detector/test3/reqs.txt: -------------------------------------------------------------------------------- 1 | django-gubbins==1.1.2 -------------------------------------------------------------------------------- /tests/requirements_detector/test3/requirements_base.txt: -------------------------------------------------------------------------------- 1 | amqp==1.0.13 2 | -------------------------------------------------------------------------------- /tests/requirements_detector/test3/requirements_test.txt: -------------------------------------------------------------------------------- 1 | South==0.8.2 -------------------------------------------------------------------------------- /tests/requirements_detector/test3/test_requirements.txt: -------------------------------------------------------------------------------- 1 | Django==1.5.2 -------------------------------------------------------------------------------- /tests/requirements_detector/test5/invalid_requirements.txt: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | django<1.6 3 | ======= 4 | django 5 | >>>>>>> -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/blank_1.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/blank_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [], 4 | "invalid_lines": [], 5 | "comments": [] 6 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/comment_1.txt: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/comment_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [], 4 | "invalid_lines": [], 5 | "comments": [ 6 | { 7 | "line_number": 1, 8 | "line": "# This is a comment" 9 | } 10 | ] 11 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/comment_2.txt: -------------------------------------------------------------------------------- 1 | req==1.0 # comment 2 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/comment_2.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "req", 6 | "specifier": [ 7 | "==1.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "req==1.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | } 31 | ], 32 | "invalid_lines": [], 33 | "comments": [ 34 | { 35 | "line_number": 1, 36 | "line": "# comment" 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/editable_1.txt: -------------------------------------------------------------------------------- 1 | -e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject 2 | --editable git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 3 | --editable hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject 4 | -e bzr+lp://MyProject#egg=MyProject 5 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/editable_2.txt: -------------------------------------------------------------------------------- 1 | -e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject # Test comment 2 | --editable git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject # Test comment 3 | --editable hg+http://hg.myproject.org/MyProject/@special_feature#egg=MyProject # Test comment 4 | -e bzr+lp://MyProject#egg=MyProject # Test comment 5 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/extras_1.txt: -------------------------------------------------------------------------------- 1 | MyPackage[PDF]==3.0 2 | Fizzy [foo, bar] 3 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/extras_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "MyPackage", 6 | "specifier": [ 7 | "==3.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": true, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "MyPackage[PDF]==3.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [ 22 | "pdf" 23 | ], 24 | "invalid_options": {}, 25 | "is_archive": null, 26 | "is_wheel": false, 27 | "is_url": null, 28 | "is_vcs_url": null, 29 | "is_name_at_url": false, 30 | "is_local_path": null, 31 | "has_egg_fragment": false 32 | }, 33 | { 34 | "name": "Fizzy", 35 | "specifier": [], 36 | "is_editable": false, 37 | "is_pinned": false, 38 | "requirement_line": { 39 | "line_number": 2, 40 | "line": "Fizzy [foo, bar]" 41 | }, 42 | "link": null, 43 | "marker": null, 44 | "install_options": [], 45 | "global_options": [], 46 | "hash_options": [], 47 | "is_constraint": false, 48 | "extras": [ 49 | "bar", 50 | "foo" 51 | ], 52 | "invalid_options": {}, 53 | "is_archive": null, 54 | "is_wheel": false, 55 | "is_url": null, 56 | "is_vcs_url": null, 57 | "is_name_at_url": false, 58 | "is_local_path": null, 59 | "has_egg_fragment": false 60 | } 61 | ], 62 | "invalid_lines": [], 63 | "comments": [] 64 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/fail_1.txt: -------------------------------------------------------------------------------- 1 | test>>1.2.0 2 | test=>1.2.0 3 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/fail_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [], 4 | "invalid_lines": [ 5 | { 6 | "line_number": 1, 7 | "line": "test>>1.2.0", 8 | "error_message": "Invalid requirement: : Expected end or semicolon (after name and no valid version specifier)\n test>>1.2.0\n ^" 9 | }, 10 | { 11 | "line_number": 2, 12 | "line": "test=>1.2.0", 13 | "error_message": "Invalid requirement: : Expected end or semicolon (after name and no valid version specifier)\n test=>1.2.0\n ^" 14 | } 15 | ], 16 | "comments": [] 17 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/fail_2.txt: -------------------------------------------------------------------------------- 1 | novcs+http://example.com#egg=a 2 | svn+http://example.com#egg 3 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/fail_2.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "a", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "novcs+http://example.com#egg=a" 12 | }, 13 | "link": "novcs+http://example.com#egg=a", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": false, 23 | "is_url": false, 24 | "is_vcs_url": false, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": true 28 | }, 29 | { 30 | "name": null, 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "svn+http://example.com#egg" 37 | }, 38 | "link": "svn+http://example.com#egg", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": null, 48 | "is_url": true, 49 | "is_vcs_url": true, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": true 53 | } 54 | ], 55 | "invalid_lines": [], 56 | "comments": [] 57 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/file_1.txt: -------------------------------------------------------------------------------- 1 | file:///path/to/your/lib/project#egg=MyProject 2 | file://../../lib/project#egg=MyProject 3 | path/to/SomeProject#egg=SomeOtherProject 4 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/file_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "MyProject", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "file:///path/to/your/lib/project#egg=MyProject" 12 | }, 13 | "link": "file:///path/to/your/lib/project#egg=MyProject", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": false, 23 | "is_url": true, 24 | "is_vcs_url": false, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": true 28 | }, 29 | { 30 | "name": null, 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "file://../../lib/project#egg=MyProject" 37 | }, 38 | "link": "/../lib/project", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": null, 48 | "is_url": false, 49 | "is_vcs_url": false, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": true 53 | }, 54 | { 55 | "name": "SomeOtherProject", 56 | "specifier": [], 57 | "is_editable": false, 58 | "is_pinned": false, 59 | "requirement_line": { 60 | "line_number": 3, 61 | "line": "path/to/SomeProject#egg=SomeOtherProject" 62 | }, 63 | "link": "path/to/SomeProject#egg=SomeOtherProject", 64 | "marker": null, 65 | "install_options": [], 66 | "global_options": [], 67 | "hash_options": [], 68 | "is_constraint": false, 69 | "extras": [], 70 | "invalid_options": {}, 71 | "is_archive": false, 72 | "is_wheel": false, 73 | "is_url": false, 74 | "is_vcs_url": false, 75 | "is_name_at_url": false, 76 | "is_local_path": true, 77 | "has_egg_fragment": true 78 | } 79 | ], 80 | "invalid_lines": [], 81 | "comments": [] 82 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/file_2.txt: -------------------------------------------------------------------------------- 1 | -e path/to/AnotherProject#egg=AnotherProject 2 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/file_2.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "AnotherProject", 6 | "specifier": [], 7 | "is_editable": true, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "-e path/to/AnotherProject#egg=AnotherProject" 12 | }, 13 | "link": "path/to/AnotherProject#egg=AnotherProject", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": false, 23 | "is_url": false, 24 | "is_vcs_url": false, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": true 28 | } 29 | ], 30 | "invalid_lines": [], 31 | "comments": [] 32 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/illustrative_requirements.txt: -------------------------------------------------------------------------------- 1 | -e git+https://github.com/davidfischer/requirements-parser.git#egg=requirements 2 | Django >=1.5, <1.6 3 | numpy 4 | DocParser [PDF] 5 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/recursive_1.txt: -------------------------------------------------------------------------------- 1 | -r recursive_2.txt 2 | Django==1.6 -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/recursive_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [ 3 | { 4 | "line_number": 1, 5 | "line": "-r recursive_2.txt", 6 | "requirements": [ 7 | "recursive_2.txt" 8 | ] 9 | } 10 | ], 11 | "requirements": [ 12 | { 13 | "name": "Django", 14 | "specifier": [ 15 | "==1.6" 16 | ], 17 | "is_editable": false, 18 | "is_pinned": true, 19 | "requirement_line": { 20 | "line_number": 2, 21 | "line": "Django==1.6" 22 | }, 23 | "link": null, 24 | "marker": null, 25 | "install_options": [], 26 | "global_options": [], 27 | "hash_options": [], 28 | "is_constraint": false, 29 | "extras": [], 30 | "invalid_options": {}, 31 | "is_archive": null, 32 | "is_wheel": false, 33 | "is_url": null, 34 | "is_vcs_url": null, 35 | "is_name_at_url": false, 36 | "is_local_path": null, 37 | "has_egg_fragment": false 38 | } 39 | ], 40 | "invalid_lines": [], 41 | "comments": [] 42 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/recursive_2.txt: -------------------------------------------------------------------------------- 1 | -r recursive_3.txt 2 | Jinja -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/recursive_2.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [ 3 | { 4 | "line_number": 1, 5 | "line": "-r recursive_3.txt", 6 | "requirements": [ 7 | "recursive_3.txt" 8 | ] 9 | } 10 | ], 11 | "requirements": [ 12 | { 13 | "name": "Jinja", 14 | "specifier": [], 15 | "is_editable": false, 16 | "is_pinned": false, 17 | "requirement_line": { 18 | "line_number": 2, 19 | "line": "Jinja" 20 | }, 21 | "link": null, 22 | "marker": null, 23 | "install_options": [], 24 | "global_options": [], 25 | "hash_options": [], 26 | "is_constraint": false, 27 | "extras": [], 28 | "invalid_options": {}, 29 | "is_archive": null, 30 | "is_wheel": false, 31 | "is_url": null, 32 | "is_vcs_url": null, 33 | "is_name_at_url": false, 34 | "is_local_path": null, 35 | "has_egg_fragment": false 36 | } 37 | ], 38 | "invalid_lines": [], 39 | "comments": [] 40 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/recursive_3.expected: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "specifier": true, 4 | "local_file": false, 5 | "name": "ipdb", 6 | "editable": false, 7 | "subdirectory": null, 8 | "uri": null, 9 | "extras": [], 10 | "vcs": null, 11 | "path": null, 12 | "line": "ipdb", 13 | "hash_name": null, 14 | "hash": null, 15 | "specs": [], 16 | "revision": null 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/recursive_3.txt-expected.json: -------------------------------------------------------------------------------- 1 | ipdb -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/rtfd_deploy_requirements.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011 Charles Leifer, Eric Holscher, Bobby Grace 2 | # 3 | # Permission is hereby granted, free of charge, to any person 4 | # obtaining a copy of this software and associated documentation 5 | # files (the "Software"), to deal in the Software without 6 | # restriction, including without limitation the rights to use, 7 | # copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the 9 | # Software is furnished to do so, subject to the following 10 | # conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be 13 | # included in all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | # OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | 25 | psycopg2 26 | gunicorn 27 | pysolr 28 | python-memcached 29 | dnspython 30 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/simple_1.txt: -------------------------------------------------------------------------------- 1 | z3c.checkversions==0.4.1 2 | MyPackage 3 | Framework==0.9.4 4 | Library>=0.2 5 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/specs_1.txt: -------------------------------------------------------------------------------- 1 | PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1 2 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/specs_1.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "PickyThing", 6 | "specifier": [ 7 | "<1.6", 8 | ">1.9", 9 | "!=1.9.6", 10 | "<2.0a0", 11 | "==2.4c1" 12 | ], 13 | "is_editable": false, 14 | "is_pinned": false, 15 | "requirement_line": { 16 | "line_number": 1, 17 | "line": "PickyThing<1.6,>1.9,!=1.9.6,<2.0a0,==2.4c1" 18 | }, 19 | "link": null, 20 | "marker": null, 21 | "install_options": [], 22 | "global_options": [], 23 | "hash_options": [], 24 | "is_constraint": false, 25 | "extras": [], 26 | "invalid_options": {}, 27 | "is_archive": null, 28 | "is_wheel": false, 29 | "is_url": null, 30 | "is_vcs_url": null, 31 | "is_name_at_url": false, 32 | "is_local_path": null, 33 | "has_egg_fragment": false 34 | } 35 | ], 36 | "invalid_lines": [], 37 | "comments": [] 38 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/subdirectory.txt: -------------------------------------------------------------------------------- 1 | -e git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup 2 | git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup 3 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/subdirectory.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "MyProject", 6 | "specifier": [], 7 | "is_editable": true, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "-e git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup" 12 | }, 13 | "link": "git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": false, 23 | "is_url": true, 24 | "is_vcs_url": true, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": true 28 | }, 29 | { 30 | "name": "MyProject", 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup" 37 | }, 38 | "link": "git+git://git.myproject.org/MyProject#egg=MyProject&subdirectory=setup", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": false, 48 | "is_url": true, 49 | "is_vcs_url": true, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": true 53 | } 54 | ], 55 | "invalid_lines": [], 56 | "comments": [] 57 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/underscores.txt: -------------------------------------------------------------------------------- 1 | a_b>=1.0 2 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/underscores.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "a_b", 6 | "specifier": [ 7 | ">=1.0" 8 | ], 9 | "is_editable": false, 10 | "is_pinned": false, 11 | "requirement_line": { 12 | "line_number": 1, 13 | "line": "a_b>=1.0" 14 | }, 15 | "link": null, 16 | "marker": null, 17 | "install_options": [], 18 | "global_options": [], 19 | "hash_options": [], 20 | "is_constraint": false, 21 | "extras": [], 22 | "invalid_options": {}, 23 | "is_archive": null, 24 | "is_wheel": false, 25 | "is_url": null, 26 | "is_vcs_url": null, 27 | "is_name_at_url": false, 28 | "is_local_path": null, 29 | "has_egg_fragment": false 30 | } 31 | ], 32 | "invalid_lines": [], 33 | "comments": [] 34 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/uri.txt: -------------------------------------------------------------------------------- 1 | http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97 2 | http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask 3 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/uri.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": null, 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97" 12 | }, 13 | "link": "http://pypi.python.org/packages/source/p/pytz/pytz-2016.4.tar.gz#md5=a3316cf3842ed0375ba5931914239d97", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [], 20 | "invalid_options": {}, 21 | "is_archive": false, 22 | "is_wheel": null, 23 | "is_url": true, 24 | "is_vcs_url": false, 25 | "is_name_at_url": false, 26 | "is_local_path": true, 27 | "has_egg_fragment": false 28 | }, 29 | { 30 | "name": "Flask", 31 | "specifier": [], 32 | "is_editable": false, 33 | "is_pinned": false, 34 | "requirement_line": { 35 | "line_number": 2, 36 | "line": "http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask" 37 | }, 38 | "link": "http://pypi.python.org/packages/source/f/flask/Flask-0.11.1.tar.gz#sha256=1212aaf123911123babc024abaa&egg=Flask", 39 | "marker": null, 40 | "install_options": [], 41 | "global_options": [], 42 | "hash_options": [], 43 | "is_constraint": false, 44 | "extras": [], 45 | "invalid_options": {}, 46 | "is_archive": false, 47 | "is_wheel": false, 48 | "is_url": true, 49 | "is_vcs_url": false, 50 | "is_name_at_url": false, 51 | "is_local_path": true, 52 | "has_egg_fragment": false 53 | } 54 | ], 55 | "invalid_lines": [], 56 | "comments": [] 57 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/vcs_bzr.txt: -------------------------------------------------------------------------------- 1 | -e bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject 2 | -e bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject 3 | -e bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject 4 | -e bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject 5 | -e bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject 6 | -e bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject 7 | 8 | bzr+http://bzr.myproject.org/MyProject/trunk#egg=MyProject 9 | bzr+sftp://user@myproject.org/MyProject/trunk#egg=MyProject 10 | bzr+ssh://user@myproject.org/MyProject/trunk#egg=MyProject 11 | bzr+ftp://user@myproject.org/MyProject/trunk#egg=MyProject 12 | bzr+https://bzr.myproject.org/MyProject/trunk@2019#egg=MyProject 13 | bzr+http://bzr.myproject.org/MyProject/trunk@v1.0#egg=MyProject 14 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/vcs_git.txt: -------------------------------------------------------------------------------- 1 | -e git+git://git.myproject.org/MyProject#egg=MyProject 2 | -e git+https://git.myproject.org/MyProject#egg=MyProject 3 | -e git+ssh://git.myproject.org/MyProject#egg=MyProject 4 | -e git+ssh://git@git.myproject.org/MyProject#egg=MyProject 5 | -e git://git.myproject.org/MyProject.git@master#egg=MyProject 6 | -e git://git.myproject.org/MyProject.git@v1.0#egg=MyProject 7 | -e git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 8 | 9 | git+git://git.myproject.org/MyProject#egg=MyProject 10 | git+https://git.myproject.org/MyProject#egg=MyProject 11 | git+ssh://git.myproject.org/MyProject#egg=MyProject 12 | git://git.myproject.org/MyProject.git@master#egg=MyProject 13 | git://git.myproject.org/MyProject.git@v1.0#egg=MyProject 14 | git://git.myproject.org/MyProject.git@da39a3ee5e6b4b0d3255bfef95601890afd80709#egg=MyProject 15 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/vcs_git_extras_require.txt: -------------------------------------------------------------------------------- 1 | git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security] 2 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/vcs_git_extras_require.txt-expected.json: -------------------------------------------------------------------------------- 1 | { 2 | "options": [], 3 | "requirements": [ 4 | { 5 | "name": "MyProject", 6 | "specifier": [], 7 | "is_editable": false, 8 | "is_pinned": false, 9 | "requirement_line": { 10 | "line_number": 1, 11 | "line": "git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security]" 12 | }, 13 | "link": "git+https://git.myproject.org/MyProject.git@v0.1#egg=MyProject[security]", 14 | "marker": null, 15 | "install_options": [], 16 | "global_options": [], 17 | "hash_options": [], 18 | "is_constraint": false, 19 | "extras": [ 20 | "security" 21 | ], 22 | "invalid_options": {}, 23 | "is_archive": false, 24 | "is_wheel": false, 25 | "is_url": true, 26 | "is_vcs_url": true, 27 | "is_name_at_url": false, 28 | "is_local_path": true, 29 | "has_egg_fragment": true 30 | } 31 | ], 32 | "invalid_lines": [], 33 | "comments": [] 34 | } -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/vcs_hg.txt: -------------------------------------------------------------------------------- 1 | -e hg+http://hg.myproject.org/MyProject#egg=MyProject 2 | -e hg+https://hg.myproject.org/MyProject#egg=MyProject 3 | -e hg+ssh://hg.myproject.org/MyProject#egg=MyProject 4 | -e hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject 5 | -e hg+http://hg.myproject.org/MyProject@2019#egg=MyProject 6 | -e hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject 7 | -e hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject 8 | 9 | hg+http://hg.myproject.org/MyProject#egg=MyProject 10 | hg+https://hg.myproject.org/MyProject#egg=MyProject 11 | hg+ssh://hg.myproject.org/MyProject#egg=MyProject 12 | hg+http://hg.myproject.org/MyProject@da39a3ee5e6b#egg=MyProject 13 | hg+http://hg.myproject.org/MyProject@2019#egg=MyProject 14 | hg+http://hg.myproject.org/MyProject@v1.0#egg=MyProject 15 | hg+http://hg.myproject.org/MyProject@special_feature#egg=MyProject 16 | -------------------------------------------------------------------------------- /tests/requirements_parser_reqfiles/vcs_svn.txt: -------------------------------------------------------------------------------- 1 | -e svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject 2 | -e svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject 3 | 4 | svn+svn://svn.myproject.org/svn/MyProject#egg=MyProject 5 | svn+http://svn.myproject.org/svn/MyProject/trunk@2019#egg=MyProject 6 | -------------------------------------------------------------------------------- /tests/test_dparse.py.LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017, Jannis Gebauer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /tests/test_packaging_legacy_version.py.ABOUT: -------------------------------------------------------------------------------- 1 | about_resource: test_packaging_legacy_version.py 2 | name: packaging 3 | description: Core utilities for Python packages 4 | homepage_url: https://github.com/pypa/packaging 5 | version: 21.4.dev0 6 | license_expression: BSD-2-Clause or Apache-2.0 7 | copyright: copyright (c) Donald Stufft and individual contributors 8 | -------------------------------------------------------------------------------- /tests/test_packaging_legacy_version.py.LICENSE: -------------------------------------------------------------------------------- 1 | This software is made available under the terms of *either* of the licenses 2 | found in LICENSE.APACHE or LICENSE.BSD. Contributions to this software is made 3 | under the terms of *both* these licenses. 4 | -------------------------------------------------------------------------------- /tests/test_packaging_legacy_version.py.LICENSE.BSD: -------------------------------------------------------------------------------- 1 | Copyright (c) Donald Stufft and individual contributors. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /tests/test_requirements_detector_detection.py.LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /tests/test_requirements_parser.py: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | 3 | # Originally from: 4 | # name = "requirements-parser" 5 | # description = "This is a small Python module for parsing Pip requirement files." 6 | # authors = [ 7 | # "Paul Horton ", 8 | # "David Fischer (@davidfischer)", 9 | # "Trey Hunner (@treyhunner)", 10 | # "Dima Veselov (@dveselov)", 11 | # "Sascha Peilicke (@saschpe)", 12 | # "Jayson Reis (@jaysonsantos)", 13 | # "Max Shenfield (@mshenfield)", 14 | # "Nicolas Delaby (@ticosax)", 15 | # "Stéphane Bidoul (@sbidoul)" 16 | # ] 17 | # maintainers = ["Paul Horton "] 18 | # homepage = "https://github.com/madpah/requirements-parser" 19 | 20 | # This file is part of requirements-parser library. 21 | # 22 | # Licensed under the Apache License, Version 2.0 (the "License"); 23 | # you may not use this file except in compliance with the License. 24 | # You may obtain a copy of the License at 25 | # 26 | # http://www.apache.org/licenses/LICENSE-2.0 27 | # 28 | # Unless required by applicable law or agreed to in writing, software 29 | # distributed under the License is distributed on an "AS IS" BASIS, 30 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 31 | # See the License for the specific language governing permissions and 32 | # limitations under the License. 33 | # 34 | # SPDX-License-Identifier: Apache-2.0 35 | 36 | # this has been significantly modified to use our own JSON tests 37 | # instead of the original ones 38 | 39 | import json 40 | import os 41 | 42 | import pytest 43 | 44 | import pip_requirements_parser 45 | 46 | REQFILES_DIR = os.path.join( 47 | os.path.dirname(__file__), 48 | "requirements_parser_reqfiles", 49 | ) 50 | 51 | ALL_REQFILES = [ 52 | os.path.join(REQFILES_DIR, rf) 53 | for rf in os.listdir(REQFILES_DIR) 54 | if rf.endswith(".txt") 55 | ] 56 | 57 | 58 | @pytest.mark.parametrize("test_file", ALL_REQFILES) 59 | def test_RequirementsFile_to_dict( 60 | test_file: str, 61 | regen=False, 62 | ) -> None: 63 | 64 | expected_file = test_file + "-expected.json" 65 | results = pip_requirements_parser.RequirementsFile.from_file(test_file).to_dict() 66 | if regen: 67 | with open (expected_file, 'w') as outp: 68 | json.dump(results, outp, indent=2) 69 | expected = results 70 | else: 71 | with open (expected_file) as inp: 72 | expected = json.load(inp) 73 | 74 | assert results == expected 75 | -------------------------------------------------------------------------------- /tests/test_skeleton_codestyle.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) nexB Inc. and others. All rights reserved. 3 | # ScanCode is a trademark of nexB Inc. 4 | # SPDX-License-Identifier: Apache-2.0 5 | # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. 6 | # See https://github.com/aboutcode-org/skeleton for support or download. 7 | # See https://aboutcode.org for more information about nexB OSS projects. 8 | # 9 | 10 | import subprocess 11 | import unittest 12 | import configparser 13 | 14 | 15 | class BaseTests(unittest.TestCase): 16 | def test_skeleton_codestyle(self): 17 | """ 18 | This test shouldn't run in proliferated repositories. 19 | """ 20 | setup_cfg = configparser.ConfigParser() 21 | setup_cfg.read("setup.cfg") 22 | if setup_cfg["metadata"]["name"] != "skeleton": 23 | return 24 | 25 | args = "venv/bin/black --check -l 100 setup.py etc tests" 26 | try: 27 | subprocess.check_output(args.split()) 28 | except subprocess.CalledProcessError as e: 29 | print("===========================================================") 30 | print(e.output) 31 | print("===========================================================") 32 | raise Exception( 33 | "Black style check failed; please format the code using:\n" 34 | " python -m black -l 100 setup.py etc tests", 35 | e.output, 36 | ) from e 37 | --------------------------------------------------------------------------------