Repository: Abdur-rahmaanJ/shopcube (language: python)

Issue:
Enhancement: change the requirements structure
Use [`pip-tools`](https://github.com/jazzband/pip-tools) (`pip-compile` and `pip-sync`) to generate `requirement.txt` from `setup.py`. Better to create a new folder `requirements` with `dev.in`, `test.in`, and `docs.in` and respective `.txt` files that are generated by `pip-compile`.  See for example https://github.com/pallets/flask/tree/master/requirements and https://jamescooke.info/a-successful-pip-tools-workflow-for-managing-python-package-requirements.html


Discussion / hints:

Fix patch:
diff --git a/dev_requirements.txt b/dev_requirements.txt
deleted file mode 100644
index 6455dfa5..00000000
--- a/dev_requirements.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-flake8==3.8.4
-black==20.8b1
-isort==5.6.4
-Sphinx==3.2.1
-sphinx-autobuild
-pytest==6.1.1
-pytest-order==0.9.5
-tox==3.21.0
-pytest-cov==2.11.1
-codecov==2.1.11
-factory-boy==3.2.0
-freezegun==1.1.0
-pytest-dotenv
diff --git a/requirements.txt b/requirements.txt
index 1855ba9d..cc8451f4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -4,11 +4,8 @@ flask-marshmallow==0.14.0
 email-validator==1.1.1
 Flask-Login==0.5.0
 Flask-Migrate==2.5.3
-Flask-Reuploaded==0.3.2
 Flask-WTF==0.14.3
-marshmallow==3.8.0
 marshmallow-sqlalchemy==0.23.1
-Pillow==8.1.1
-flask-mailman==0.1.7
+flask-mailman==0.2.2
 flask-admin==1.5.7
 SQLAlchemy<1.4
diff --git a/requirements/dev.in b/requirements/dev.in
new file mode 100644
index 00000000..89a7fa3b
--- /dev/null
+++ b/requirements/dev.in
@@ -0,0 +1,8 @@
+-r tests.in
+-r docs.in
+pip-tools
+flake8
+black
+isort
+codecov
+tox
diff --git a/requirements/dev.txt b/requirements/dev.txt
new file mode 100644
index 00000000..3fe8bd99
--- /dev/null
+++ b/requirements/dev.txt
@@ -0,0 +1,164 @@
+#
+# This file is autogenerated by pip-compile
+# To update, run:
+#
+#    pip-compile requirements/dev.in
+#
+alabaster==0.7.12
+    # via sphinx
+appdirs==1.4.4
+    # via
+    #   black
+    #   virtualenv
+atomicwrites==1.4.0
+    # via pytest
+attrs==20.3.0
+    # via pytest
+babel==2.9.0
+    # via sphinx
+black==20.8b1
+    # via -r requirements/dev.in
+certifi==2020.12.5
+    # via requests
+chardet==4.0.0
+    # via requests
+click==7.1.2
+    # via
+    #   black
+    #   pip-tools
+codecov==2.1.11
+    # via
+    #   -r requirements/dev.in
+    #   -r requirements\tests.in
+colorama==0.4.4
+    # via
+    #   pytest
+    #   sphinx
+    #   tox
+coverage==5.5
+    # via codecov
+distlib==0.3.1
+    # via virtualenv
+docutils==0.16
+    # via sphinx
+factory-boy==3.2.0
+    # via -r requirements\tests.in
+faker==8.1.0
+    # via factory-boy
+filelock==3.0.12
+    # via
+    #   tox
+    #   virtualenv
+flake8==3.9.1
+    # via -r requirements/dev.in
+freezegun==1.1.0
+    # via -r requirements\tests.in
+idna==2.10
+    # via requests
+imagesize==1.2.0
+    # via sphinx
+iniconfig==1.1.1
+    # via pytest
+isort==5.8.0
+    # via -r requirements/dev.in
+jinja2==2.11.3
+    # via sphinx
+markupsafe==1.1.1
+    # via jinja2
+mccabe==0.6.1
+    # via flake8
+mypy-extensions==0.4.3
+    # via black
+packaging==20.9
+    # via
+    #   pytest
+    #   sphinx
+    #   tox
+pathspec==0.8.1
+    # via black
+pep517==0.10.0
+    # via pip-tools
+pip-tools==6.1.0
+    # via -r requirements/dev.in
+pluggy==0.13.1
+    # via
+    #   pytest
+    #   tox
+py==1.10.0
+    # via
+    #   pytest
+    #   tox
+pycodestyle==2.7.0
+    # via flake8
+pyflakes==2.3.1
+    # via flake8
+pygments==2.8.1
+    # via sphinx
+pyparsing==2.4.7
+    # via packaging
+pytest-dotenv==0.5.2
+    # via -r requirements\tests.in
+pytest-order==0.11.0
+    # via -r requirements\tests.in
+pytest==6.2.3
+    # via
+    #   -r requirements\tests.in
+    #   pytest-dotenv
+    #   pytest-order
+python-dateutil==2.8.1
+    # via
+    #   faker
+    #   freezegun
+python-dotenv==0.17.0
+    # via pytest-dotenv
+pytz==2021.1
+    # via babel
+regex==2021.4.4
+    # via black
+requests==2.25.1
+    # via
+    #   codecov
+    #   sphinx
+six==1.15.0
+    # via
+    #   python-dateutil
+    #   tox
+    #   virtualenv
+snowballstemmer==2.1.0
+    # via sphinx
+sphinx==3.5.4
+    # via -r requirements\docs.in
+sphinxcontrib-applehelp==1.0.2
+    # via sphinx
+sphinxcontrib-devhelp==1.0.2
+    # via sphinx
+sphinxcontrib-htmlhelp==1.0.3
+    # via sphinx
+sphinxcontrib-jsmath==1.0.1
+    # via sphinx
+sphinxcontrib-qthelp==1.0.3
+    # via sphinx
+sphinxcontrib-serializinghtml==1.1.4
+    # via sphinx
+text-unidecode==1.3
+    # via faker
+toml==0.10.2
+    # via
+    #   black
+    #   pep517
+    #   pytest
+    #   tox
+tox==3.23.0
+    # via -r requirements/dev.in
+typed-ast==1.4.3
+    # via black
+typing-extensions==3.7.4.3
+    # via black
+urllib3==1.26.4
+    # via requests
+virtualenv==20.4.3
+    # via tox
+
+# The following packages are considered to be unsafe in a requirements file:
+# pip
+# setuptools
diff --git a/requirements/docs.in b/requirements/docs.in
new file mode 100644
index 00000000..1b3a6e86
--- /dev/null
+++ b/requirements/docs.in
@@ -0,0 +1,1 @@
+sphinx
\ No newline at end of file
diff --git a/requirements/docs.txt b/requirements/docs.txt
new file mode 100644
index 00000000..dc9636f9
--- /dev/null
+++ b/requirements/docs.txt
@@ -0,0 +1,57 @@
+#
+# This file is autogenerated by pip-compile
+# To update, run:
+#
+#    pip-compile requirements/docs.in
+#
+alabaster==0.7.12
+    # via sphinx
+babel==2.9.0
+    # via sphinx
+certifi==2020.12.5
+    # via requests
+chardet==4.0.0
+    # via requests
+colorama==0.4.4
+    # via sphinx
+docutils==0.16
+    # via sphinx
+idna==2.10
+    # via requests
+imagesize==1.2.0
+    # via sphinx
+jinja2==2.11.3
+    # via sphinx
+markupsafe==1.1.1
+    # via jinja2
+packaging==20.9
+    # via sphinx
+pygments==2.8.1
+    # via sphinx
+pyparsing==2.4.7
+    # via packaging
+pytz==2021.1
+    # via babel
+requests==2.25.1
+    # via sphinx
+snowballstemmer==2.1.0
+    # via sphinx
+sphinx==3.5.4
+    # via -r requirements/docs.in
+sphinxcontrib-applehelp==1.0.2
+    # via sphinx
+sphinxcontrib-devhelp==1.0.2
+    # via sphinx
+sphinxcontrib-htmlhelp==1.0.3
+    # via sphinx
+sphinxcontrib-jsmath==1.0.1
+    # via sphinx
+sphinxcontrib-qthelp==1.0.3
+    # via sphinx
+sphinxcontrib-serializinghtml==1.1.4
+    # via sphinx
+urllib3==1.26.4
+    # via requests
+
+# The following packages are considered to be unsafe in a requirements file:
+# setuptools
diff --git a/tox.ini b/tox.ini
index 3bebbe5c..a304a38c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,7 +10,7 @@ skip_missing_interpreters=true
 changedir = shopyo
 deps = 
     #setuptools
-    -rdev_requirements.txt
+    -rrequirements/tests.txt
 commands = 
-    coverage run --branch --source=. -m pytest -v --tb=short {posargs}
+    coverage run --branch --source=. -m pytest {posargs}
     coverage report


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index f8009061..aba8b963 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -41,7 +41,7 @@ jobs:
         uses: actions/cache@v2
         with:
           path: ${{ steps.pip-cache.outputs.dir }}
-          key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements.txt') }}|${{ hashFiles('dev_requirements.txt') }}
+          key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}|${{ hashFiles('requirements.txt') }}
       - run: pip install tox codecov
       - run: tox -e py
       - name: Upload coverage to Codecov
diff --git a/requirements/tests.in b/requirements/tests.in
new file mode 100644
index 00000000..c957ff61
--- /dev/null
+++ b/requirements/tests.in
@@ -0,0 +1,6 @@
+pytest
+pytest-order
+factory-boy
+freezegun
+pytest-dotenv
+coverage
diff --git a/requirements/tests.txt b/requirements/tests.txt
new file mode 100644
index 00000000..043fc042
--- /dev/null
+++ b/requirements/tests.txt
@@ -0,0 +1,63 @@
+#
+# This file is autogenerated by pip-compile
+# To update, run:
+#
+#    pip-compile requirements/tests.in
+#
+atomicwrites==1.4.0
+    # via pytest
+attrs==20.3.0
+    # via pytest
+certifi==2020.12.5
+    # via requests
+chardet==4.0.0
+    # via requests
+codecov==2.1.11
+    # via -r requirements/tests.in
+colorama==0.4.4
+    # via pytest
+coverage==5.5
+    # via codecov
+factory-boy==3.2.0
+    # via -r requirements/tests.in
+faker==8.1.0
+    # via factory-boy
+freezegun==1.1.0
+    # via -r requirements/tests.in
+idna==2.10
+    # via requests
+iniconfig==1.1.1
+    # via pytest
+packaging==20.9
+    # via pytest
+pluggy==0.13.1
+    # via pytest
+py==1.10.0
+    # via pytest
+pyparsing==2.4.7
+    # via packaging
+pytest-dotenv==0.5.2
+    # via -r requirements/tests.in
+pytest-order==0.11.0
+    # via -r requirements/tests.in
+pytest==6.2.3
+    # via
+    #   -r requirements/tests.in
+    #   pytest-dotenv
+    #   pytest-order
+python-dateutil==2.8.1
+    # via
+    #   faker
+    #   freezegun
+python-dotenv==0.17.0
+    # via pytest-dotenv
+requests==2.25.1
+    # via codecov
+six==1.15.0
+    # via python-dateutil
+text-unidecode==1.3
+    # via faker
+toml==0.10.2
+    # via pytest
+urllib3==1.26.4
+    # via requests