Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support poetry.lock #7

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

Support poetry.lock #7

wants to merge 19 commits into from

Commits on Nov 24, 2019

  1. Switch Heroku account used by Travis CI

    Change the HEROKU_API_KEY and HEROKU_API_USER environment variables used by
    Travis CI. The encrypted values were generated using the following commands:
    
      heroku authorizations:create --description "For Travis"
      travis login --com
      travis encrypt HEROKU_API_KEY=<token> --add --com
      travis encrypt HEROKU_API_USER=<[email protected]> --add --com
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    17bea38 View commit details
    Browse the repository at this point in the history
  2. Use a separate CI job per stack

    Run the tests in a separate CI job per test suite and stack. Testing on
    all stacks in a single job exceeds Travis time limits.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    494cc76 View commit details
    Browse the repository at this point in the history
  3. Allow running specific tests by passing TESTS

    Make it possible to specify individual tests to run, to facilitate
    debugging. Running the entire test suite every time can take quite long.
    Tests can be specified by passing the TESTS variable to `make test`.
    
    If TESTS is non-empty, the test script defines the `suite` hook to build
    the test suite using `suite_addTest` with each specified test function.
    If TESTS is unset or empty, shUnit2's default behaviour is to run all
    functions beginning with the word `test`.
    
    See https://github.com/kward/shunit2#-suites
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    a887282 View commit details
    Browse the repository at this point in the history
  4. Skip undefined functions when processing TESTS

    Do not attempt to invoke test functions specified via the TESTS
    environment variable if they are not defined. The Makefile invokes
    multiple test scripts and each test function is only defined in one of
    them.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    cc735a6 View commit details
    Browse the repository at this point in the history
  5. Do not run all tests when no tests match TESTS

    Define a noop test function when TESTS is passed and no function in the
    test script matches the contents of TESTS. The noop function merely
    prints a line notifying the user that the tests were skipped.
    
    This happens because tests were split up into multiple test scripts, but
    the Makefile passes TESTS to all of them. When the `suite` hook does not
    invoke `suite_addTest`, shunit2 falls back to running all defined tests.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    99d0e51 View commit details
    Browse the repository at this point in the history
  6. Upgrade to pip 19.2.3

    Bump PIP_UPDATE from 9.0.2 to 19.2.3. This variable is used in bin/steps/python
    to determine which pip version to install or upgrade to.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    193af75 View commit details
    Browse the repository at this point in the history
  7. Upgrade to pip 19.1.1 for Python 3.4 projects

    Python 3.4 support was dropped in pip >= 19.2. For projects still on
    this Python version, use pip 19.1.1 instead of pip 19.2.1.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    c3dc702 View commit details
    Browse the repository at this point in the history
  8. Adapt pip-pop to changes in pip >= 10

    The pip-diff and pip-grep tools from the vendorized `pip-pop` package
    import internal modules from pip. In pip >= 10, internal modules were
    moved under `pip._internal`, breaking the imports. Use `try...except
    ImportError` to handle both import paths.
    
    Also, the interface of the `PackageFinder` class from one of these
    modules changed. Provide a wrapper function to allow creating objects of
    this type using the old interface.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    32d1e2c View commit details
    Browse the repository at this point in the history
  9. Pin to pip 9.0.2 for pipenv users only

    This addresses an issue raised by @CaseyFeist during code review:
    
      Updating pip for pipenv users or requiring them to update without a
      heads up won't be a good experience (our version is old enough that
      they'll need to uninstall and reinstall pipenv locally to successfully
      update). If you can refactor this to stay pinned to current version for
      pipenv users only, I should be able to accept this (and the related
      project updates).
    
      heroku/heroku-buildpack-python#833 (comment)
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    83ffd2a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    281b51d View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    0bae9f0 View commit details
    Browse the repository at this point in the history
  12. Add tests for pyproject.toml-style projects using poetry

    Add two test cases for projects using poetry as the build backend:
    
    - testPoetry: project without dependencies
    
    - testPoetryLock: project with dependencies, using a poetry.lock file
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    b3ed583 View commit details
    Browse the repository at this point in the history
  13. Add tests for pyproject.toml-style projects using flit

    Add two test cases for projects using flit as the build backend:
    
    - testFlit: project without dependencies
    
    - testFlitRequires: project with dependencies
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    9cacd3f View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    ddcd782 View commit details
    Browse the repository at this point in the history
  15. Add failing test for poetry.lock

    Check that pinned requirements are honored when poetry.lock is present.
    Request an outdated version of marshmallow in poetry.lock (3.0.0). Check
    that the outdated version is installed, rather than a newer version
    also satisfying the version constraint in pyproject.toml (^3.0.0).
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    7627068 View commit details
    Browse the repository at this point in the history
  16. Do not write requirements.txt for pyproject.toml-based projects

    Install pyproject.toml-based projects using `pip install .`. Do not use a
    requirements.txt for this. The requirements.txt file is needed to handle pinned
    versions extracted from the poetry.lock file.
    
    Note that we cannot simply append `.` to the exported requirements.txt file.
    Currently pip requires that either all requirements have a hash or none.
    Including `.` would thus force us to omit hashes for all requirements.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    073a423 View commit details
    Browse the repository at this point in the history
  17. Install pinned dependencies from poetry.lock

    If a poetry.lock file is present, use the Poetry CLI to export the
    pinned requirements to a requirements.txt file. If the project already
    contains a requirements.txt, use that and ignore poetry.lock.
    
    Poetry is not used to install the project because it does not clean up
    stale requirements. This means that requirements need to be exported
    anyway, for the `pip-uninstall` step.
    
    Since we only use Poetry to export a requirements.txt file, ignore the
    Poetry version specified in pyproject.toml. Install a pre-release of
    1.0.0 because the export command is not available before 1.0.0a0.
    
    Note that supporting pyproject.toml-based installations is not enough to
    handle pinned requirements: When pip installs a pyproject.toml-style
    project using the process described in PEP 517, it only uses Poetry to
    build a wheel. The wheel contains the version constraints from
    pyproject.toml, not the pinned versions from poetry.lock.
    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    ebf2831 View commit details
    Browse the repository at this point in the history
  18. Upgrade to poetry 1.0.0b7

    cjolowicz committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    22407f1 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    3332d1b View commit details
    Browse the repository at this point in the history