From 13a6b852e37df9ef8d282b0b7863513560642fee Mon Sep 17 00:00:00 2001 From: SKairinos Date: Mon, 11 Dec 2023 11:32:57 +0000 Subject: [PATCH] fix: remove requirements sync --- .github/workflows/main.yml | 39 +------------ pyproject.toml | 2 +- setup.py | 114 +++++++++---------------------------- 3 files changed, 28 insertions(+), 127 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9e152cdd..721b09d2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,44 +45,10 @@ jobs: - name: ๐Ÿงช Test Code Units run: pipenv run pytest - sync: - runs-on: ubuntu-latest - needs: [test] - steps: - - name: ๐Ÿ›ซ Checkout - uses: actions/checkout@v3 - - - name: ๐Ÿ Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: ๐Ÿ›  Install Dependencies - run: | - python -m pip install --upgrade pip - # pipenv-setup requires downgraded vistir: https://github.com/Madoshakalaka/pipenv-setup/issues/138 - python -m pip install pipenv-setup[black]==3.2.0 vistir==0.6.1 - - - name: โš™๏ธ Configure Git - run: | - git config --local user.name cfl-bot - git config --local user.email codeforlife-bot@ocado.com - - - name: ๐Ÿ”„ Sync Setup Dependencies - run: | - pipenv-setup sync - git add setup.py - - # Only commit and push if there are differences. - if ! git diff --staged --quiet; then - git commit -m "ci[setup]: sync dependencies [skip ci]" - git push - fi - release: concurrency: release runs-on: ubuntu-latest - needs: [sync] + needs: [test] if: github.ref_name == 'main' steps: - name: ๐Ÿ›ซ Checkout @@ -91,9 +57,6 @@ jobs: token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} fetch-depth: 0 - - name: ๐Ÿ”„ Sync Setup Dependencies - run: git pull - - name: ๐Ÿ Set up Python uses: actions/setup-python@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 17a1a0d7..75a801c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ upload_to_release = true [tool.black] line-length = 80 -extend-exclude = "^/setup.py|^/codeforlife/user/migrations/" +extend-exclude = "^/codeforlife/user/migrations/" [tool.pytest.ini_options] env = ["DJANGO_SETTINGS_MODULE=manage"] diff --git a/setup.py b/setup.py index bed2dd4c..8a796ac6 100644 --- a/setup.py +++ b/setup.py @@ -1,8 +1,13 @@ """ +ยฉ Ocado Group +Created on 11/12/2023 at 10:59:40(+00:00). + Setup the Code for Life package during installation. """ +import json import os +import typing as t from setuptools import find_packages, setup @@ -15,7 +20,26 @@ data_files, root_dir = [], os.path.dirname(__file__) for dir_path, dir_names, file_names in os.walk(DATA_DIR): rel_data_dir = os.path.relpath(dir_path, root_dir) - data_files += [os.path.join(rel_data_dir, file_name) for file_name in file_names] + data_files += [ + os.path.join(rel_data_dir, file_name) for file_name in file_names + ] + +# Parse Pipfile.lock into strings. +install_requires: t.List[str] = [] +with open("Pipfile.lock", "r", encoding="utf-8") as pipfile_lock: + packages: t.Dict[str, t.Dict[str, t.Any]] = json.load(pipfile_lock)[ + "default" + ] + for name, package in packages.items(): + requirement = name + if "extras" in package: + requirement += f"[{','.join(package['extras'])}]" + if "version" in package: + requirement += package["version"] + if "markers" in package: + requirement += f"; {package['markers']}" + install_requires.append(requirement) + setup( name="codeforlife", @@ -31,92 +55,6 @@ data_files=[(str(DATA_DIR), data_files)], package_data={"codeforlife": ["py.typed"]}, python_requires="==3.8.*", - # These will be synced with Pipfile by the pipeline. - # DO NOT edit these manually. Instead, update the Pipfile. - install_requires=[ - "aimmo==2.10.6", - "asgiref==3.7.2; python_version >= '3.7'", - "attrs==23.1.0; python_version >= '3.7'", - "cachetools==5.3.1; python_version >= '3.7'", - "certifi==2023.7.22; python_version >= '3.6'", - "cfl-common==6.37.1", - "charset-normalizer==3.3.0; python_full_version >= '3.7.0'", - "click==8.1.7; python_version >= '3.7'", - "codeforlife-portal==6.37.1", - "defusedxml==0.7.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "diff-match-patch==20230430; python_version >= '3.7'", - "django==3.2.20", - "django-classy-tags==2.0.0", - "django-cors-headers==4.1.0", - "django-countries==7.3.1", - "django-csp==3.7", - "django-filter==23.2", - "django-formtools==2.2", - "django-import-export==3.3.1; python_version >= '3.8'", - "django-js-reverse==0.9.1", - "django-otp==1.0.2", - "django-phonenumber-field==6.4.0; python_version >= '3.7'", - "django-pipeline==2.0.8", - "django-preventconcurrentlogins==0.8.2", - "django-ratelimit==3.0.1; python_version >= '3.4'", - "django-recaptcha==2.0.6", - "django-sekizai==2.0.0", - "django-treebeard==4.3.1", - "django-two-factor-auth==1.13.2", - "djangorestframework==3.13.1", - "dnspython==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "et-xmlfile==1.1.0; python_version >= '3.6'", - "eventlet==0.31.0", - "flask==2.2.3", - "google-auth==2.23.3; python_version >= '3.7'", - "greenlet==3.0.0; python_version >= '3.7'", - "hypothesis==5.41.3; python_version >= '3.6'", - "idna==3.4; python_version >= '3.5'", - "importlib-metadata==4.13.0", - "itsdangerous==2.1.2; python_version >= '3.7'", - "jinja2==3.1.2; python_version >= '3.7'", - "kubernetes==26.1.0; python_version >= '3.6'", - "libsass==0.22.0; python_version >= '3.6'", - "markuppy==1.14", - "markupsafe==2.1.3; python_version >= '3.7'", - "more-itertools==8.7.0; python_version >= '3.5'", - "numpy==1.24.4; python_version >= '3.8'", - "oauthlib==3.2.2; python_version >= '3.6'", - "odfpy==1.4.1", - "openpyxl==3.1.2", - "pandas==2.0.3; python_version >= '3.8'", - "pgeocode==0.4.0; python_version >= '3.8'", - "phonenumbers==8.12.12", - "pillow==10.0.1; python_version >= '3.8'", - "pyasn1==0.5.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "pyasn1-modules==0.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "pydantic==1.10.7", - "pyhamcrest==2.0.2; python_version >= '3.5'", - "pyjwt==2.6.0; python_version >= '3.7'", - "pyotp==2.9.0", - "pypng==0.20220715.0", - "python-dateutil==2.8.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "pytz==2023.3.post1", - "pyyaml==5.4.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "qrcode==7.4.2; python_version >= '3.7'", - "rapid-router==5.11.3", - "reportlab==3.6.13; python_version >= '3.7' and python_version < '4'", - "requests==2.31.0; python_version >= '3.7'", - "requests-oauthlib==1.3.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "rsa==4.9; python_version >= '3.6' and python_version < '4'", - "setuptools==62.1.0; python_version >= '3.7'", - "six==1.16.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "sortedcontainers==2.4.0", - "sqlparse==0.4.4; python_version >= '3.5'", - "tablib[html,ods,xls,xlsx,yaml]==3.5.0; python_version >= '3.8'", - "typing-extensions==4.8.0; python_version >= '3.8'", - "tzdata==2023.3; python_version >= '2'", - "urllib3==2.0.6; python_version >= '3.7'", - "websocket-client==1.6.4; python_version >= '3.8'", - "werkzeug==3.0.0; python_version >= '3.8'", - "xlrd==2.0.1", - "xlwt==1.3.0", - "zipp==3.17.0; python_version >= '3.8'", - ], + install_requires=install_requires, dependency_links=[], )