Skip to content

Commit

Permalink
Merge pull request #1355 from jefer94/feat/capyc
Browse files Browse the repository at this point in the history
move exceptions to capy core
  • Loading branch information
tommygonzaleza committed May 7, 2024
2 parents 919a327 + d64b0e8 commit 506b45c
Show file tree
Hide file tree
Showing 165 changed files with 4,030 additions and 1,533 deletions.
89 changes: 44 additions & 45 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request: {}

env:
PYTHON_VERSION: 3.11.8
PYTHON_VERSION: 3.12.3
PYTHONUNBUFFERED: 1
APP_URL: https://4geeks.com

Expand Down Expand Up @@ -46,9 +46,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install dependencies using Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -88,9 +88,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand All @@ -114,39 +114,38 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Calculate initial MD5 for Pipfile.lock
id: calculate-md5-1
run: echo "MD5_1=$(python -m scripts.md5 ./Pipfile.lock)" >> $GITHUB_ENV

# # Cache Pipenv packages
# - name: Cache Pipenv packages
# uses: actions/cache@v2
# id: cache
# with:
# path: |
# ~/.local/share/virtualenvs
# ~/.cache/pip
# key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pipenv-3-11-8-
# Cache Pipenv packages
- name: Cache Pipenv packages
uses: actions/cache@v2
id: cache
with:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
# if: steps.cache.outputs.cache-hit == 'true'
if: steps.cache.outputs.cache-hit == 'true'
run: |
pip install pipenv
pipenv install --dev
- name: Calculate initial MD5 for Pipfile.lock
id: calculate-md5-1
run: pipenv run pip freeze -r requirements.txt > requirements.txt

- name: Update dependencies
run: |
pipenv update --dev --bare
- name: Calculate updated MD5 for Pipfile.lock
id: calculate-md5-2
run: echo "MD5_2=$(python -m scripts.md5 ./Pipfile.lock)" >> $GITHUB_ENV
run: pipenv run pip freeze -r requirements2.txt > requirements2.txt


- name: Check Pipfile.lock is up-to-date
run: |
if [ "$MD5_1" != "$MD5_2" ]; then
echo "Pipfile.lock is out of date. Please run 'pipenv lock --dev' and commit the updated Pipfile.lock.";
exit 1;
fi
run: diff requirements.txt requirements2.txt

undefined-and-unused-variables:
needs: cache
Expand All @@ -169,9 +168,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -203,9 +202,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -237,9 +236,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -271,9 +270,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -305,9 +304,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -339,9 +338,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -392,9 +391,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down Expand Up @@ -430,9 +429,9 @@ jobs:
path: |
~/.local/share/virtualenvs
~/.cache/pip
key: ${{ runner.os }}-pipenv-3-11-8-${{ hashFiles('**/Pipfile.lock') }}
key: ${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pipenv-3-11-8-
${{ runner.os }}-${{ env.PYTHON_VERSION }}-
# Install Pipenv
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ RUN sudo apt-get update \
# RUN curl https://pyenv.run | bash


# RUN pyenv update && pyenv install 3.11.8 && pyenv global 3.11.8
RUN pyenv install 3.11.8 && pyenv global 3.11.8
# RUN pyenv update && pyenv install 3.12.3 && pyenv global 3.12.3
RUN pyenv install 3.12.3 && pyenv global 3.12.3
RUN pip install pipenv yapf

# remove PIP_USER environment
Expand Down
8 changes: 4 additions & 4 deletions .heroku.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ RUN apt update -y \
&& apt update -y -qq \
&& apt upgrade -y -qq \
&& apt install -y -qq --no-install-recommends software-properties-common curl libcap2-bin \
python3.11 python3.11-dev pip libpq-dev libboost-all-dev kmod sudo \
python3.12 python3.12-dev pip libpq-dev libboost-all-dev kmod sudo \
&& apt clean -y -qq \
&& rm -rf /var/cache/apt/* /var/lib/apt/lists/* /tmp/*

RUN python3.11 -m pip install pipenv && \
python3.11 -m pip cache purge && \
RUN python3.12 -m pip install pipenv && \
python3.12 -m pip cache purge && \
rm -rf $HOME/.cache/pipenv /tmp/*

RUN useradd -ms /bin/bash 4geeks
Expand Down Expand Up @@ -53,7 +53,7 @@ RUN echo $NEW_RELIC_LICENSE_KEY
RUN echo ${NEW_RELIC_LICENSE_KEY}

RUN pipenv install --system --deploy --ignore-pipfile && \
python3.11 -m pip cache purge && \
python3.12 -m pip cache purge && \
rm -rf $HOME/.cache/pipenv /tmp/*

# RUN newrelic-infra
2 changes: 1 addition & 1 deletion .newrelic.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ COPY . /app
WORKDIR /app

RUN python3 --version
RUN python3.11 --version
RUN python3.12 --version

RUN pipenv install --system --deploy --ignore-pipfile && \
pip3 cache purge && \
Expand Down
5 changes: 4 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ pep8-naming = "*"
flake8-bugbear = "*"
pytest-gevent = "*"
pytest-asyncio = "*"
google-apps-meet = "*"
google-auth-httplib2 = "*"
google-auth-oauthlib = "*"

[packages]
django = "*"
Expand Down Expand Up @@ -84,7 +87,6 @@ djangorestframework-csv = "*"
python-slugify = "*"
pyyaml = "*"
uritemplate = "*"
django-sql-explorer = {extras = ["xls"] }
google-cloud-ndb = "*"
whitenoise = {extras = ["brotli"] }
channels = "*"
Expand Down Expand Up @@ -137,3 +139,4 @@ aiodns = "*"
eventlet = "*"
linked-services = {extras = ["django", "aiohttp", "requests"], version = "*"}
celery-task-manager = {extras = ["django"], version = "*"}
django-sql-explorer = {extras = ["xls"], version = "==4.0.2"}
Loading

0 comments on commit 506b45c

Please sign in to comment.