Skip to content

Commit 97d9437

Browse files
authored
Merge branch 'master' into dependabot/pip/django-3.2.20
2 parents 7d7e6da + 83032be commit 97d9437

File tree

112 files changed

+786
-1415
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+786
-1415
lines changed

.github/workflows/test.yaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,50 @@ jobs:
2828
matrix:
2929
python-version: [3.9]
3030
env:
31-
DJANGO: 3.0
31+
DJANGO: 3.0
3232
SECRET_KEY: supersecret
33-
DB_PORT: 5432
33+
DB_PORT: 5432
3434
POSTGRES_HOST: localhost
3535
POSTGRES_PASSWORD: somepassword
3636
POSTGRES_USER: postgres
3737
POSTGRES_DB: testing_db
3838
DJANGO_SETTINGS_MODULE: pyarweb.settings.development
3939
steps:
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v4
41+
4142
- name: Set up Python ${{ matrix.python-version }}
42-
uses: actions/setup-python@v2
43+
uses: actions/setup-python@v4
4344
with:
4445
python-version: ${{ matrix.python-version }}
46+
4547
- name: Install system libraries
4648
run: |
4749
sudo apt-get install -y libpq-dev libxml2-dev libxslt1-dev
50+
51+
- name: Cache dependencies
52+
uses: actions/cache@v3
53+
with:
54+
path: ~/.cache/pip
55+
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev_requirements.txt') }}
56+
restore-keys: |
57+
${{ runner.os }}-pip-
58+
4859
- name: Install dependencies
4960
run: |
5061
python -m pip install --upgrade pip
5162
pip install -r dev_requirements.txt
52-
- name: Lint with flake8
63+
64+
- name: Check Code Style
65+
uses: pre-commit/[email protected]
66+
67+
- name: Check for Django migrations
5368
run: |
54-
flake8
69+
python manage.py makemigrations --dry-run --check
70+
5571
- name: Run migrations
5672
run: |
57-
python manage.py migrate
73+
python manage.py migrate
74+
5875
- name: Run tests
5976
run: |
6077
pytest -v

.github/workflows/upload_to_dockerhub.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ jobs:
2020
steps:
2121
- name: Check out the repo
2222
uses: actions/checkout@v3
23-
23+
2424
- name: Log in to Docker Hub
2525
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
2626
with:
2727
username: ${{ secrets.DOCKER_USERNAME }}
2828
password: ${{ secrets.DOCKER_PASSWORD }}
29-
29+
3030
- name: Extract metadata (tags, labels) for Docker
3131
id: meta
3232
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
3333
with:
3434
images: my-docker-hub-namespace/my-docker-hub-repository
35-
35+
3636
- name: Build and push Docker image
3737
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
3838
with:

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: check-merge-conflict
7+
- id: debug-statements
8+
9+
- repo: https://github.com/pycqa/flake8
10+
rev: 7.1.1
11+
hooks:
12+
- id: flake8
13+
args:
14+
- '--config=.flake8'
15+
- '--exclude=.venv,**/migrations/*.py'
16+
17+
- repo: https://github.com/asottile/pyupgrade
18+
rev: v3.19.1
19+
hooks:
20+
- id: pyupgrade
21+
args: [--py39-plus]
22+
23+
- repo: https://github.com/adamchainz/django-upgrade
24+
rev: "1.22.2"
25+
hooks:
26+
- id: django-upgrade
27+
args: [--target-version, "3.2"]

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
FROM python:3.9
22
ENV PYTHONUNBUFFERED 1
33
ENV PYTHONPATH /code:$PYTHONPATH
4+
RUN apt-get update && apt-get -y install flite=2.2-5
45
RUN mkdir /code
56
WORKDIR /code
67
COPY dev_requirements.txt /code

INSTALLATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## Guia de instalación
1+
## Guia de instalación
22

33
Seguí los pasos en nuestra wiki: https://github.com/PyAr/pyarweb/wiki/Instalacion-con-Docker

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ only_test:
2828
pep8:
2929
docker-compose run --rm web flake8
3030

31+
format:
32+
pre-commit run -a
33+
3134
test: pep8 only_test
3235

3336
dockershell:

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ instrucciones generales en [esta página de la wiki](https://github.com/PyAr/pya
2020

2121
podés ver las instrucciones en [esta página de la wiki](https://github.com/PyAr/pyarweb/wiki/Instalacion-con-Docker)
2222

23+
## Lint & Format
24+
25+
Para correr el linter y el formateador de código, podés correr:
26+
27+
```bash
28+
make format
29+
```
2330

2431
## Más info
2532

community/templates/_tags_filtering_form.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
</div>
1414
<div class="ma-5" style="margin-top:15px;">
1515
<label>
16-
<input name="active" type="hidden" value="{{ active|yesno:'false,true' }}">
17-
<input id="show-active" type="checkbox" {% if not active %}checked{% endif %} />
16+
<input name="active" type="hidden" value="{{ active|yesno:'true,false' }}">
17+
<input id="show-active" type="checkbox" {% if active %}checked{% endif %} />
1818
{% trans 'Mostrar solo ofertas activas' %}
1919
</label>
2020
</div>
@@ -25,7 +25,7 @@ <h4 class="list-group-item-heading">{% trans 'Filtrar por etiqueta' %} <button t
2525
</header>
2626
<article class="list-group-item" style="padding:30px;">
2727
<div class="row">
28-
{% for tag in tags %}
28+
{% for tag in usefultags %}
2929
<select name="tag_{{ tag.slug }}" id="tag_{{ tag.slug }}" class="hidden">
3030
<option value=""></option>
3131
<option value="1" {% if tag.slug in included %}selected{% endif %}></option>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% load i18n %}
2+
{% spaceless %}
3+
<div class="form-group">
4+
<label class="control-label">{{ label }}</label>
5+
<div class="form-group">
6+
<div class="input-group mb-3">
7+
<div class="input-group-prepend">
8+
<img src="{{ image }}" alt="captcha" class="captcha" />
9+
{% if audio %}
10+
<audio
11+
title="{% trans "Play CAPTCHA as audio file" %}"
12+
src="{{ audio }}"
13+
alt="captcha audio"
14+
controls
15+
style="display: block; padding-bottom: 1rem;"
16+
>
17+
{% endif %}
18+
</div>
19+
{% include "django/forms/widgets/multiwidget.html" %}
20+
</div>
21+
</div>
22+
</div>
23+
{% endspaceless %}

community/templates/base.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<link rel="icon" href="{% static 'img/icons/pyar.ico' %}" type="image/ico">
2929

3030
{% block extra_head %}{% endblock %}
31-
31+
3232
{% if GOOGLE_TRACKING_ID %}
3333
<!-- Global site tag (gtag.js) - Google Analytics -->
3434
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-169755710-1"></script>
@@ -48,9 +48,9 @@
4848
background-image: url({% static "img/pyar-footer.png" %});
4949
}
5050

51-
#footer li.usla {
52-
background-image: url({% static "img/usla-footer.png" %});
53-
padding-right: 80px;
51+
#footer li.azure {
52+
background-image: url({% static "img/azure-footer.png" %});
53+
padding-right: 50px;
5454
}
5555

5656
#footer li.python {

0 commit comments

Comments
 (0)