Commit Graph

7239 Commits

Author SHA1 Message Date
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
Frost Ming c8f34ddb8a Merge pull request #4908 from jfly/issue-4885-custom-indices-lacking-hashes
Use a PackageFinder with `ignore_compatibility` when collecting hashes
2022-01-07 15:11:31 +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 b0ebaf054e Merge pull request #4907 from milo-minderbinder/bugfix/requirements-file-options
disallow abbreviated forms of full option names
2022-01-06 15:12:30 +08:00
Milo Minderbinder d535301e1f disallow abbreviated forms of full option names
Previously, due to default behavior of ArgumentParser, global --index-url,
--extra-index-url, and --trusted-host options in requirements files could be
abbreviated (e.g. "--index" == "--index-url"). As a result, unexpected
behavior could occur during processing of a requirements file with these
shortened option names when using Pipenv, which could be exploited by a
malicious actor to surreptitiously insert pip options using non-obvious
abbreviations.

For example, adding a line with "--t example.com" to the
requirements file would cause Pipenv to treat example.com as trusted, even
when example.com presents an invalid TLS certificate.

This commit disables support for abbreviated options in the ArgumentParser,
to align Pipenv's behavior when parsing global options in a requirements
file with the behavior in pip, as expected.
2022-01-06 00:47:37 -05:00
Frost Ming 3ab4763d4a news for #4877 2022-01-04 19:11:06 +08:00
Frost Ming 14ddbbd8e2 Merge pull request #4899 from pypa/fix/reject-illegal-requirements-txt
Fix the index parsing to reject illegal requirements
2021-12-29 11:09:30 +08:00
Frost Ming 33cbabe20c fix pip location 2021-12-23 15:20:11 +08:00
Frost Ming a30ec71254 fix comment ignorance 2021-12-23 12:53:42 +08:00
Frost Ming 32146365bf remove the useless option 2021-12-23 11:27:23 +08:00
Frost Ming 3d678257b7 Fix the index parsing 2021-12-23 10:49:17 +08:00
Frost Ming cdde3f7bce Fix #4881 installation fails when extra index url is given 2021-11-25 22:34:14 +08:00
Frost Ming e69ce684f9 Merge pull request #4877 from ReazNahid/patch-1
duplicate parentheses removed
2021-11-24 12:08:28 +08:00
Frost Ming f0f6846fe2 Merge pull request #4878 from belkka/patch-1
Add a clickable link to PEP 508 in index.rst
2021-11-24 12:08:13 +08:00
belkka aec666e54d Add a clickable link to PEP 508 2021-11-24 05:47:34 +02:00
Frost Ming 1a5584e9a5 Release v2021.11.23 2021-11-23 23:24:23 +08:00
Reaz Nahid 789e25686f duplicate parentheses removed 2021-11-22 20:43:22 +06:00
Frost Ming ce1930d483 Merge pull request #4874 from pypa/fix/install-with-index-url
[bug] Fix a bug of source saving in Pipfile
2021-11-18 16:33:05 +08:00
Frost Ming eda189aad8 Add a test case to verify the fix 2021-11-18 15:26:30 +08:00
Frost Ming 29af360d34 Support index name in --index 2021-11-18 14:32:57 +08:00
Frost Ming 9c0c554064 add news entry 2021-11-18 12:49:41 +08:00
Frost Ming 317a39762c Fix a bug that index url is not correctly saved in Pipfile 2021-11-18 12:48:24 +08:00
Frost Ming 3dec34cae9 Merge pull request #4870 from pypa/vendor/charset-normalizer
[vendor] Update charset-normalizer
2021-11-17 16:01:57 +08:00
Frost Ming 4a244d2671 lock on windows python36 2021-11-17 14:41:00 +08:00
Frost Ming b90c469590 Update dependencies 2021-11-17 12:07:20 +08:00
Frost Ming 21b6a0839f Include py3.6 testing in CI matrix 2021-11-17 11:10:34 +08:00
Frost Ming ff4529a15e add news entry 2021-11-17 11:09:19 +08:00
Frost Ming eb39b8c81a Upgrade charset-normalizer to 2.0.7 2021-11-17 11:07:57 +08:00
Frost Ming eafcfb2c1e Fix a bug of deleting a virtualenv that is not managed by Pipenv
Close #4867
2021-11-17 00:06:13 +08:00
Frost Ming b0ceaed5bc Release v2021.11.15 2021-11-15 09:36:53 +08:00
Frost Ming 9889634d4c remove duplicate headings 2021-11-15 00:05:06 +08:00
Frost Ming b61fafe0c0 Update README with completion instruction 2021-11-15 00:02:23 +08:00
Frost Ming b503e8b3aa Update README with GH action badge 2021-11-12 16:31:53 +08:00
Frost Ming 47a73bb0a5 Merge pull request #4862 from pypa/vendor/update-click
Update vendored click to 8.0.3
2021-11-12 14:28:21 +08:00
Frost Ming 95f473631a drop chardet 2021-11-12 12:04:04 +08:00
Frost Ming 8bdb310ca3 Update vendored click to 8.0.3 2021-11-12 11:57:33 +08:00
Frost Ming 2482e2d3a4 Merge pull request #4861 from pypa/fix/vendoring 2021-11-12 11:45:22 +08:00
Frost Ming 6e3fadc5a7 Fix imports in pip_shims 2021-11-12 10:31:19 +08:00
Frost Ming 66e9fbed5f Fix the vendoring imports 2021-11-12 09:34:05 +08:00
Frost Ming 2d2a0fa15c rewrite imports 2021-11-11 23:33:10 +08:00
Frost Ming 11229406ba Remove jinja2 from vendor directory
Close #4858
2021-11-11 21:55:38 +08:00
Frost Ming 1524315baf make the doc more accurate
close #4856
2021-11-11 17:23:13 +08:00
Frost Ming 76d6fcc5c5 Merge pull request #4853 from pypa:bugfix/virtualenv_python
Don't use sys.executable when inside a venv
2021-11-09 22:58:30 +08:00
Frost Ming 6d207c1354 Add news entry 2021-11-09 22:07:18 +08:00
Frost Ming dfa7107b2e Don't use sys.executable when inside virtualenv 2021-11-09 22:06:23 +08:00
Frost Ming 2dfdf2a2bd Return an empty dict when PIPENV_DONT_LOAD_ENV is set.
Close #4851
2021-11-09 21:48:56 +08:00
Frost Ming 9cafc59188 update README 2021-11-09 14:28:27 +08:00
Frost Ming ea388f6e5b Update readme with python requires 2021-11-09 14:27:03 +08:00