Skip to content
Myr

Merge pull request #3620 from pallets/requirements

Before adoption: this commit came in with the history the project adopted, so no landing records it.

use pip-compile to pin dev requirements

authored by David Lord · committed by GitHub · parents 295e1e7, eea31f2 · Browse files · 13 files+254 added−109 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

13 files+254 added−109 removed

  • other:+254 added−109 removed

13 files+254 added−109 removed

deleted:docs/requirements.txt-5 removed
1Sphinx~=3.0.02Pallets-Sphinx-Themes~=1.2.33sphinxcontrib-log-cabinet~=1.0.14sphinx-issues~=1.2.05packaging~=20.3
added:requirements/dev.in+5 added
1-r docs.in2-r tests.in3pip-tools4pre-commit5tox
added:requirements/dev.txt+59 added
1#2# This file is autogenerated by pip-compile3# To update, run:4#5# pip-compile requirements/dev.in6#7alabaster==0.7.12 # via sphinx8appdirs==1.4.4 # via virtualenv9attrs==19.3.0 # via pytest10babel==2.8.0 # via sphinx11blinker==1.4 # via -r requirements/tests.in12certifi==2020.4.5.1 # via requests13cfgv==3.1.0 # via pre-commit14chardet==3.0.4 # via requests15click==7.1.2 # via pip-tools16distlib==0.3.0 # via virtualenv17docutils==0.16 # via sphinx18filelock==3.0.12 # via tox, virtualenv19greenlet==0.4.15 # via -r requirements/tests.in20identify==1.4.16 # via pre-commit21idna==2.9 # via requests22imagesize==1.2.0 # via sphinx23jinja2==2.11.2 # via sphinx24markupsafe==1.1.1 # via jinja225more-itertools==8.3.0 # via pytest26nodeenv==1.3.5 # via pre-commit27packaging==20.4 # via -r requirements/docs.in, pallets-sphinx-themes, pytest, sphinx, tox28pallets-sphinx-themes==1.2.3 # via -r requirements/docs.in29pip-tools==5.1.2 # via -r requirements/dev.in30pluggy==0.13.1 # via pytest, tox31pre-commit==2.4.0 # via -r requirements/dev.in32py==1.8.1 # via pytest, tox33pygments==2.6.1 # via sphinx34pyparsing==2.4.7 # via packaging35pytest==5.4.2 # via -r requirements/tests.in36python-dotenv==0.13.0 # via -r requirements/tests.in37pytz==2020.1 # via babel38pyyaml==5.3.1 # via pre-commit39requests==2.23.0 # via sphinx40six==1.15.0 # via packaging, pip-tools, tox, virtualenv41snowballstemmer==2.0.0 # via sphinx42sphinx-issues==1.2.0 # via -r requirements/docs.in43sphinx==3.0.3 # via -r requirements/docs.in, pallets-sphinx-themes, sphinx-issues, sphinxcontrib-log-cabinet44sphinxcontrib-applehelp==1.0.2 # via sphinx45sphinxcontrib-devhelp==1.0.2 # via sphinx46sphinxcontrib-htmlhelp==1.0.3 # via sphinx47sphinxcontrib-jsmath==1.0.1 # via sphinx48sphinxcontrib-log-cabinet==1.0.1 # via -r requirements/docs.in49sphinxcontrib-qthelp==1.0.3 # via sphinx50sphinxcontrib-serializinghtml==1.1.4 # via sphinx51toml==0.10.1 # via pre-commit, tox52tox==3.15.1 # via -r requirements/dev.in53urllib3==1.25.9 # via requests54virtualenv==20.0.21 # via pre-commit, tox55wcwidth==0.1.9 # via pytest5657# The following packages are considered to be unsafe in a requirements file:58# pip59# setuptools
added:requirements/docs.in+5 added
1Pallets-Sphinx-Themes2packaging3Sphinx4sphinx-issues5sphinxcontrib-log-cabinet
added:requirements/docs.txt+36 added
1#2# This file is autogenerated by pip-compile3# To update, run:4#5# pip-compile requirements/docs.in6#7alabaster==0.7.12 # via sphinx8babel==2.8.0 # via sphinx9certifi==2020.4.5.1 # via requests10chardet==3.0.4 # via requests11docutils==0.16 # via sphinx12idna==2.9 # via requests13imagesize==1.2.0 # via sphinx14jinja2==2.11.2 # via sphinx15markupsafe==1.1.1 # via jinja216packaging==20.4 # via -r requirements/docs.in, pallets-sphinx-themes, sphinx17pallets-sphinx-themes==1.2.3 # via -r requirements/docs.in18pygments==2.6.1 # via sphinx19pyparsing==2.4.7 # via packaging20pytz==2020.1 # via babel21requests==2.23.0 # via sphinx22six==1.15.0 # via packaging23snowballstemmer==2.0.0 # via sphinx24sphinx-issues==1.2.0 # via -r requirements/docs.in25sphinx==3.0.3 # via -r requirements/docs.in, pallets-sphinx-themes, sphinx-issues, sphinxcontrib-log-cabinet26sphinxcontrib-applehelp==1.0.2 # via sphinx27sphinxcontrib-devhelp==1.0.2 # via sphinx28sphinxcontrib-htmlhelp==1.0.3 # via sphinx29sphinxcontrib-jsmath==1.0.1 # via sphinx30sphinxcontrib-log-cabinet==1.0.1 # via -r requirements/docs.in31sphinxcontrib-qthelp==1.0.3 # via sphinx32sphinxcontrib-serializinghtml==1.1.4 # via sphinx33urllib3==1.25.9 # via requests3435# The following packages are considered to be unsafe in a requirements file:36# setuptools
added:requirements/tests.in+4 added
1pytest2blinker3greenlet4python-dotenv
added:requirements/tests.txt+18 added
1#2# This file is autogenerated by pip-compile3# To update, run:4#5# pip-compile requirements/tests.in6#7attrs==19.3.0 # via pytest8blinker==1.4 # via -r requirements/tests.in9greenlet==0.4.15 # via -r requirements/tests.in10more-itertools==8.3.0 # via pytest11packaging==20.4 # via pytest12pluggy==0.13.1 # via pytest13py==1.8.1 # via pytest14pyparsing==2.4.7 # via packaging15pytest==5.4.2 # via -r requirements/tests.in16python-dotenv==0.13.0 # via -r requirements/tests.in17six==1.15.0 # via packaging18wcwidth==0.1.9 # via pytest
modified:.pre-commit-config.yaml+4 added-4 removed
modified:.readthedocs.yaml+1 added-1 removed
1version: 22python:3 install:4 - requirements: requirements/docs.txt5 - method: pip6 path: .6 - requirements: docs/requirements.txt7sphinx:8 builder: dirhtml
modified:CONTRIBUTING.rst+118 added-82 removed
1 unmodified line
2==========================34Thank you for considering contributing to Flask!567Support questions8-----------------910Please, don't use the issue tracker for this. Use one of the following11resources for questions about your own code:1212* The ``#get-help`` channel on our Discord chat: https://discordapp.com/invite/t6rrQZH13- The ``#get-help`` channel on our Discord chat:14 https://discord.gg/t6rrQZH1514 * The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but15 Discord is preferred.16 - The IRC channel ``#pocoo`` on FreeNode is linked to Discord, but17 Discord is preferred.1819- The mailing list flask@python.org for long term discussion or larger17* The mailing list flask@python.org for long term discussion or larger issues.18* Ask on `Stack Overflow`_. Search with Google first using:19 ``site:stackoverflow.com flask {search term, exception message, etc.}``20 issues.21- Ask on `Stack Overflow`_. Search with Google first using:22 ``site:stackoverflow.com flask {search term, exception message, etc.}``2324.. _Stack Overflow: https://stackoverflow.com/questions/tagged/flask?sort=linked252627Reporting issues28----------------2926- Describe what you expected to happen.27- If possible, include a `minimal reproducible example`_ to help us28 identify the issue. This also helps check that the issue is not with29 your own code.30- Describe what actually happened. Include the full traceback if there was an31 exception.32- List your Python, Flask, and Werkzeug versions. If possible, check if this33 issue is already fixed in the repository.30- Describe what you expected to happen.31- If possible, include a `minimal reproducible example`_ to help us32 identify the issue. This also helps check that the issue is not with33 your own code.34- Describe what actually happened. Include the full traceback if there35 was an exception.36- List your Python, Flask, and Werkzeug versions. If possible, check37 if this issue is already fixed in the repository.3839.. _minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example404142Submitting patches43------------------4440- Use `Black`_ to autoformat your code. This should be done for you as a41 git `pre-commit`_ hook, which gets installed when you run ``pip install -e .[dev]``.42 You may also wish to use Black's `Editor integration`_.43- Include tests if your patch is supposed to solve a bug, and explain44 clearly under which circumstances the bug happens. Make sure the test fails45 without your patch.46- Include a string like "Fixes #123" in your commit message47 (where 123 is the issue you fixed).48 See `Closing issues using keywords49 <https://help.github.com/articles/creating-a-pull-request/>`__.45- Use `Black`_ to autoformat your code. This should be done for you as46 a Git `pre-commit`_ hook, set up below. You may also wish to use47 Black's `Editor integration`_.48- Include tests if your patch is supposed to solve a bug, and explain49 clearly under which circumstances the bug happens. Make sure the50 test fails without your patch.51- Include a string like "Fixes #123" in your commit message (where 12352 is the issue you fixed). See `Closing issues using keywords53 <https://help.github.com/articles/creating-a-pull-request/>`__.545556First time setup57~~~~~~~~~~~~~~~~5854- Download and install the `latest version of git`_.55- Configure git with your `username`_ and `email`_::59- Download and install the `latest version of git`_.60- Configure git with your `username`_ and `email`_.6157 git config --global user.name 'your name'58 git config --global user.email 'your email'62 .. code-block:: text6360- Make sure you have a `GitHub account`_.61- Fork Flask to your GitHub account by clicking the `Fork`_ button.62- `Clone`_ your GitHub fork locally::64 $ git config --global user.name 'your name'65 $ git config --global user.email 'your email'6664 git clone https://github.com/{username}/flask65 cd flask67- Make sure you have a `GitHub account`_.68- Fork Flask to your GitHub account by clicking the `Fork`_ button.69- `Clone`_ your GitHub fork locally.7067- Add the main repository as a remote to update later::71 .. code-block:: text7273 $ git clone https://github.com/{username}/flask74 $ cd flask7576- Add the main repository as a remote to update later::7778 .. code-block:: text7980 git remote add pallets https://github.com/pallets/flask81 git fetch pallets8272- Create a virtualenv::83- Create a virtualenv.8474 python3 -m venv env75 . env/bin/activate76 # or "env\Scripts\activate" on Windows85 .. code-block:: text8678- Install Flask in editable mode with development dependencies::87 $ python3 -m venv env88 $ . env/bin/activate8980 pip install -e ".[dev]"90 On Windows, activating is different.9182- Install the `pre-commit framework`_.83- Install the pre-commit hooks::92 .. code-block:: text9385 pre-commit install --install-hooks94 > env\Scripts\activate9596- Install Flask in editable mode with development dependencies.9798 .. code-block:: text99100 $ pip install -e . -r requirements/dev.txt101102- Install the pre-commit hooks.103104 .. code-block:: text105106 $ pre-commit install107108.. _GitHub account: https://github.com/join109.. _latest version of git: https://git-scm.com/downloads110.. _username: https://help.github.com/en/articles/setting-your-username-in-git111.. _email: https://help.github.com/en/articles/setting-your-commit-email-address-in-git112.. _Fork: https://github.com/pallets/flask/fork113.. _Clone: https://help.github.com/en/articles/fork-a-repo#step-2-create-a-local-clone-of-your-fork114.. _pre-commit framework: https://pre-commit.com/#install115116117Start coding118~~~~~~~~~~~~119120- Create a branch to identify the issue you would like to work on. If121 you're submitting a bug or documentation fix, branch off of the100 latest ".x" branch::122 latest ".x" branch.123102 git checkout -b your-branch-name origin/1.0.x124 .. code-block:: text125126 $ git checkout -b your-branch-name origin/1.0.x127128 If you're submitting a feature addition or change, branch off of the105 "master" branch::129 "master" branch.130107 git checkout -b your-branch-name origin/master131 .. code-block:: text132109- Using your favorite editor, make your changes, `committing as you go`_.110- Include tests that cover any code changes you make. Make sure the test fails111 without your patch. `Run the tests <contributing-testsuite_>`_.112- Push your commits to GitHub and `create a pull request`_ by using::133 $ git checkout -b your-branch-name origin/master134114 git push --set-upstream origin your-branch-name135- Using your favorite editor, make your changes,136 `committing as you go`_.137- Include tests that cover any code changes you make. Make sure the138 test fails without your patch.139 `Run the tests <contributing-testsuite_>`_.140- Push your commits to GitHub and `create a pull request`_.141116- Celebrate 🎉142 .. code-block:: text143144 $ git push --set-upstream origin your-branch-name145146.. _committing as you go: https://dont-be-afraid-to-commit.readthedocs.io/en/latest/git/commandlinegit.html#commit-your-changes147.. _Black: https://black.readthedocs.io148.. _Editor integration: https://black.readthedocs.io/en/stable/editor_integration.html149.. _pre-commit: https://pre-commit.com150.. _create a pull request: https://help.github.com/en/articles/creating-a-pull-request151152153.. _contributing-testsuite: #running-the-tests154155Running the tests156~~~~~~~~~~~~~~~~~157129Run the basic test suite with::158Run the basic test suite with pytest.159131 pytest160.. code-block:: text161133This only runs the tests for the current environment. Whether this is relevant134depends on which part of Flask you're working on. Travis-CI will run the full135suite when you submit your pull request.162 $ pytest163164This only runs the tests for the current environment. Whether this is165relevant depends on which part of Flask you're working on. CI will run166the full suite when you submit your pull request.167168The full test suite takes a long time to run because it tests multiple169combinations of Python and dependencies. If you don't have a Python170version installed, it will be skipped with a warning message at the end.140Run::171142 tox172.. code-block:: text173174 $ tox175176177Running test coverage178~~~~~~~~~~~~~~~~~~~~~179180Generating a report of lines that do not have test coverage can indicate148where to start contributing. Run ``pytest`` using ``coverage`` and generate a149report on the terminal and as an interactive HTML document::181where to start contributing. Run ``pytest`` using ``coverage`` and182generate a report on the terminal and as an interactive HTML document.183151 coverage run -m pytest152 coverage report153 coverage html154 # then open htmlcov/index.html184.. code-block:: text185186 $ coverage run -m pytest187 $ coverage report188 $ coverage html # then open htmlcov/index.html189190Read more about `coverage <https://coverage.readthedocs.io>`_.191192Running the full test suite with ``tox`` will combine the coverage reports193from all runs.
1 unmodified line
195196Building the docs197~~~~~~~~~~~~~~~~~198165Build the docs in the ``docs`` directory using Sphinx::199Build the docs in the ``docs`` directory using Sphinx.200167 cd docs168 pip install -r requirements.txt169 make html201.. code-block:: text202203 $ cd docs204 $ make html205206Open ``_build/html/index.html`` in your browser to view the docs.207208Read more about `Sphinx <https://www.sphinx-doc.org/en/master/>`_.209210211Caution: zero-padded file modes212-------------------------------213179This repository contains several zero-padded file modes that may cause issues180when pushing this repository to git hosts other than GitHub. Fixing this is181destructive to the commit history, so we suggest ignoring these warnings. If it182fails to push and you're using a self-hosted git service like GitLab, you can183turn off repository checks in the admin panel.214This repository contains several zero-padded file modes that may cause215issues when pushing this repository to Git hosts other than GitHub.216Fixing this is destructive to the commit history, so we suggest ignoring217these warnings. If it fails to push and you're using a self-hosted Git218service like GitLab, you can turn off repository checks in the admin219panel.220185These files can also cause issues while cloning. If you have ::221These files can also cause issues while cloning if you have222``fsckObjects`` enabled with either of the following in your git config.223224.. code-block::225226 [fetch]188 fsckobjects = true227 fsckObjects = true228190or ::191229 [receive]230 fsckObjects = true231195set in your git configuration file, cloning this repository will fail. The only196solution is to set both of the above settings to false while cloning, and then197setting them back to true after the cloning is finished.232The only solution is to set both of the above to ``false``, clone, and233then set them back to ``true`` after.
modified:MANIFEST.in+1 added
1include CHANGES.rst2include CONTRIBUTING.rst3include LICENSE.rst4include tox.ini5include requirements/*.txt6graft artwork7graft docs8prune docs/_build9graft examples
2 unmodified lines
modified:setup.py+1 added-12 removed
13 unmodified lines
14 "Jinja2>=2.10.1",15 "itsdangerous>=0.24",16 "click>=5.1",17 ],18 extras_require={19 "dotenv": ["python-dotenv"],20 "dev": [21 "pytest",22 "coverage",23 "tox",24 "sphinx",25 "pallets-sphinx-themes",26 "sphinxcontrib-log-cabinet",27 "sphinx-issues",28 ],29 },18 extras_require={"dotenv": ["python-dotenv"]},19)
modified:tox.ini+2 added-5 removed
6 unmodified lines
7skip_missing_interpreters = true89[testenv]10deps =11 pytest12 greenlet13 blinker14 python-dotenv11 -r requirements/tests.txt1213 lowest: Werkzeug==0.15.514 lowest: Jinja2==2.1015 lowest: itsdangerous==0.24
16 unmodified lines
32skip_install = true33commands = pre-commit run --all-files --show-diff-on-failure3435[testenv:docs]39deps = -r docs/requirements.txt36deps = -r requirements/docs.txt37commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html