Commit Graph

839 Commits

Author SHA1 Message Date
Oz N Tiram 880f91c877 Merge pull request #4896 from den4uk/verify-hash-command
New command: verify Pipfile.lock hash is up to date
2022-02-10 11:14:31 +01:00
pinfort b60d37a859 Pattern expansion for arguments was disabled on Windows
Fix #4937.
2022-01-30 22:20:15 +01:00
Milo Minderbinder 167909839a fix TLS validation for requirements.txt
Previously, due to a probable typo in the code for importing a
requirements file to create a new pipenv project, SSL/TLS validation was
disabled by default for any package index servers specified in the
requirements file with the `--index-url` or `--extra-index-url` options.

In addition, `--trusted-host` options in the requirements file would not
work as intended, because any host or host:port pair provided with these
options was incorrectly being matched against the full URLs of the
configured index server(s) (i.e. including the scheme, path, etc.),
instead of extracting and comparing with the host and port parts only,
as intended.

This PR fixes both of these issues, flipping the existing behavior to
require SSL/TLS validation by default, and optionally allowing TLS
validation to be disabled explicitly for specific host:port with the
`--trusted-host` option if provided.
2022-01-08 22:17:49 +08:00
Frost Ming 9cb42e1acb Merge pull request #4910 from jfly/update-run-tests-instructions 2022-01-08 14:17:49 +08:00
Jeremy Fleischman 08a7fcf1cd Oops, set the CI environment variable even earlier.
If I do something like `pytest tests/integration/test_cli.py`, something
about the ordering of imports means that `pipenv.environments` gets
loaded *before* `pytest_sessionstart` runs, which means that
`pipenv.environments.PIPENV_IS_CI` ends up false.
2022-01-07 00:12:15 -08:00
Jeremy Fleischman f42fcaa2b8 Misc doc updates (mostly around running tests)
This adds and documents a workaround for
https://github.com/pypa/pipenv/issues/4909. It feels a bit weird to
pretend to be CI just to run the test suite, though. Maybe we can do
something about that later.

I ran into a lot of trouble trying to get the tests to run when working
on https://github.com/pypa/pipenv/pull/4908, and that was largely
because the instructions in this CONTRIBUTING.md file seem to have
rotted.

1. The bit about "can be run very simply" is bogus. It's
   unfortunately not that simple right now.

2. `make test` (the docker approach) fails for me with this error:

    ```bash
    $ make test
    docker-compose up
    [+] Running 1/0
     ⠿ Container pipenv-pipenv-tests-1  Recreated                                                                  0.1s
    Attaching to pipenv-pipenv-tests-1
    pipenv-pipenv-tests-1  | Collecting certifi
    pipenv-pipenv-tests-1  |   Downloading https://files.pythonhosted.org/packages/37/45/946c02767aabb873146011e665728b680884cd8fe70dde973c640e45b775/certifi-2021.10.8-py2.py3-none-any.whl (149kB)
    pipenv-pipenv-tests-1  | Installing collected packages: certifi
    pipenv-pipenv-tests-1  | Successfully installed certifi-2021.10.8
    pipenv-pipenv-tests-1  | Path: /root/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    pipenv-pipenv-tests-1  | Installing Pipenv...
    pipenv-pipenv-tests-1  | Obtaining file:///pipenv
    pipenv-pipenv-tests-1  |     Complete output from command python setup.py egg_info:
    pipenv-pipenv-tests-1  |     Traceback (most recent call last):
    pipenv-pipenv-tests-1  |       File "<string>", line 1, in <module>
    pipenv-pipenv-tests-1  |       File "/pipenv/setup.py", line 55
    pipenv-pipenv-tests-1  |         print(f"\033[1m{s}\033[0m")
    pipenv-pipenv-tests-1  |                                  ^
    pipenv-pipenv-tests-1  |     SyntaxError: invalid syntax
    pipenv-pipenv-tests-1  |
    pipenv-pipenv-tests-1  |     ----------------------------------------
    pipenv-pipenv-tests-1  | Command "python setup.py egg_info" failed with error code 1 in /pipenv/
    pipenv-pipenv-tests-1 exited with code 1
    ```

    The docker image it relies upon
    (https://hub.docker.com/r/kennethreitz/pipenv-tests) hasn't been
    updated in 4 years, so I assume it's just not something people use
    anymore?

3. Relatedly, there was a `Dockerfile` at the root of this repo that
   appears to be unused. Let me know if it's used somewhere I'm not
   realizing, I can add it back!

4. https://kennethreitz.org/essays/be-cordial-or-be-on-your-way seems to
   be a broken link now. I found
   https://kennethreitz.org/essays/2013/01/27/be-cordial-or-be-on-your-way
   on Google.

5. `./run-tests.sh` doesn't work for me. It's failing for the same
   reason described by @ncoghlan here:
   https://github.com/pypa/pip/issues/7953#issuecomment-611928262. He
   said something about a `PIPENV_BOOTSTRAP` environment variable, but I
   can't find any information about that.
2022-01-07 00:01:33 -08:00
Jeremy Fleischman 34652df63c Use a PackageFinder with ignore_compatibility when collecting hashes
This fixes https://github.com/pypa/pipenv/issues/4885
2022-01-06 22:01:43 -08:00
Frost Ming 3d678257b7 Fix the index parsing 2021-12-23 10:49:17 +08:00
Denis Sazonov f742b9a8ca added a success message for verify 2021-12-20 11:25:46 +00:00
Denis Sazonov 45f8792804 added tests for pipenv verify 2021-12-18 22:29:35 +00:00
Frost Ming eda189aad8 Add a test case to verify the fix 2021-11-18 15:26:30 +08:00
Frost Ming ff32a68771 Remove some usages of vistir.compat 2021-11-08 23:49:40 +08:00
Frost Ming 0f67a112dc Populate the PATH env in pipenv run 2021-11-08 15:02:37 +08:00
Frost Ming 7873fd94de Merge pull request #4826 from pypa/ci/py310
Run CI against Python 3.10
2021-11-05 16:13:02 +08:00
Frost Ming 264b47438c fix sys.version_info 2021-11-05 15:33:39 +08:00
Frost Ming 2636992416 Merge pull request #4800 from kobayashi/4790-handle-empty-dot-venv
Fixes #4790: behaving as no .venv if .venv is in project root and empty
2021-11-05 14:46:18 +08:00
Frost Ming 88df069d68 fix tests for 3.9 and 3.10 2021-11-05 14:45:37 +08:00
Frost Ming e06d9e0287 change a package 2021-11-05 12:43:11 +08:00
Frost Ming 99beff2db0 fix vcs test cases 2021-11-04 21:42:37 +08:00
Frost Ming 7c77435bcc fix vcs url 2021-11-04 20:38:15 +08:00
Frost Ming 30e2aac739 Fix test error 2021-11-04 18:33:43 +08:00
Frost Ming e78ead7484 Don't include self for resolution for editable deps 2021-11-04 16:06:59 +08:00
Frost Ming 9dbf157f8b delete useless tests 2021-11-04 16:06:59 +08:00
kobayashi f26c9b5235 behave as no .venv if .venv is in project root and empty 2021-10-03 01:03:04 -04:00
Ikko Ashimine dd1fdce056 Fix typo in test_cli.py
begining -> beginning
2021-08-17 22:20:18 +09:00
Frost Ming 904f0a3b86 capture outputs written in subprocesses 2021-08-03 10:41:19 +08:00
Frost Ming 443547fee5 show 10 slowest cases 2021-08-03 10:41:17 +08:00
Frost Ming 46ea38fcca Isolate environment variables 2021-08-03 10:41:17 +08:00
Frost Ming 6a221cf732 Don't share project objects but create own 2021-07-30 12:31:43 +08:00
Frost Ming 6ef9344a5f Avoid wait() on processes 2021-07-29 14:42:52 +08:00
Frost Ming 9b4eb98529 Remove unused patch files 2021-07-28 17:30:17 +08:00
Frost Ming a82bbb7b27 Try switching from delegator to subprocess 2021-07-28 16:39:36 +08:00
Frost Ming ca5d931f1f Update to py36 plus syntax 2021-07-28 10:59:00 +08:00
Frost Ming dcd06330e4 Update pythonfinder to 1.2.8 2021-07-27 15:11:29 +08:00
Frost Ming fac3eaeaa7 Revendor packages and update patches 2021-07-27 09:45:57 +08:00
Frost Ming c863ca1a4b Remove unused submodules 2021-07-26 23:35:27 +08:00
Frost Ming 306731cbe0 Update test cases according to the latest pip 2021-07-26 16:48:55 +08:00
Frost Ming 8c9039d0af Remove passa from vendors 2021-07-26 15:41:19 +08:00
Frost Ming 6cdfa218cc Update pypi artifacts 2021-04-23 10:02:40 +08:00
Isheros dc882677e9 Added fix for bug 4141 2020-12-07 01:51:02 -06:00
Isheros 122379026a Added a test for the bug 2020-12-07 01:48:42 -06:00
Frost Ming e583f75a74 Change the pipfile format 2020-11-13 10:32:37 +08:00
Frost Ming 0a7235b12e Add test case 2020-11-12 22:06:25 +08:00
Frost Ming 7fe01318f1 resolver take the missing dev argument 2020-11-10 17:26:56 +08:00
Frost Ming 466707bd85 Show waring about what happened when a dep is skipped 2020-11-09 12:34:44 +08:00
Frost Ming 698ef8cdd2 improve test performance 2020-11-02 11:11:57 +08:00
Frost Ming e6edaa6977 Disable ssh check 2020-11-02 11:11:56 +08:00
Frost Ming 72b571bd06 Change multiple styles in CLI output 2020-11-02 11:11:54 +08:00
Frost Ming 4f4de7bcfe Fix release tuple construction 2020-10-28 10:50:02 +08:00
Frost Ming 98fbe2fc5a Supply sha256 checksum to mocked PyPI 2020-10-28 10:44:02 +08:00