Skip to content

Commit

Permalink
Merge branch 'master' into update_irc
Browse files Browse the repository at this point in the history
  • Loading branch information
gilgamezh committed Jan 25, 2025
2 parents 1acba45 + 016fc93 commit 19661eb
Show file tree
Hide file tree
Showing 259 changed files with 9,119 additions and 6,305 deletions.
14 changes: 14 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copy as .env and replace with correct values
TELEGRAM_BOT_TOKEN=xxxx
TELEGRAM_MODERATORS_CHAT_ID=xxx
TELEGRAM_PUBLIC_CHAT_ID=xxx
FACEBOOK_PAGE_ACCESS_TOKEN=xxx
FACEBOOK_PAGE_ID=xxx
TWITTER_ACCESS_TOKEN=xxx
TWITTER_ACCESS_SECRET=xxx
TWITTER_CONSUMER_KEY=xxx
TWITTER_CONSUMER_SECRET=xxx
DISCOURSE_HOST=example.com
DISCOURSE_API_KEY=abcdef1235
DISCOURSE_USERNAME=xxxx
DISCOURSE_CATEGORY=1
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Informe de errores
description: Crea un informe de errores para ayudarnos a mejorar.
body:
- type: markdown
attributes:
value: |
Gracias por tomarse el tiempo de rellenar un informe de error. Recuerde rellenar todos los campos, incluido el título.
- type: textarea
id: current
attributes:
label: Comportamiento actual
description: |
Describa aquí el problema o la cuestión.
validations:
required: true
- type: textarea
id: expected
attributes:
label: Comportamiento esperado
description: |
Díganos qué debería pasar en su lugar.
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Pasos para reproducir el problema
description: |
¿Qué tiene que hacer alguien más para encontrarse con el mismo fallo?
placeholder: |
1. Paso 1
2. Paso 2
3. Paso 3
4. ...
validations:
required: true
- type: textarea
id: extra
attributes:
label: Notas adicionales
description: |
¿Tiene alguna nota extra que pueda ayudar a resolver el problema y que no encaje en ningún otro campo?
placeholder: |
No
validations:
required: false
- type: textarea
id: commit
attributes:
label: pyAr rev. hash/commit
description: |
¿Qué commit estaba utilizando cuando obtuvo el problema? (en caso de no ser el ultimo)
validations:
required: true
- type: input
id: os
attributes:
label: Sistema operativo
description: |
Sistema operativo, es decir, Windows 10 x64, Debian 10 x64, etc.
validations:
required: true
- type: markdown
attributes:
value: |
Gracias por su contribución.
40 changes: 30 additions & 10 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -11,7 +11,7 @@ jobs:
# Label used to access the service container
postgres2:
# Docker Hub image
image: postgres:9.4
image: postgres:11.5
# Provide the password for postgres
env:
POSTGRES_PASSWORD: somepassword
Expand All @@ -26,32 +26,52 @@ jobs:
--health-retries 5
strategy:
matrix:
python-version: [3.6, 3.7]
python-version: [3.9]
env:
DJANGO: 1.8
DJANGO: 3.0
SECRET_KEY: supersecret
DB_PORT: 5432
DB_PORT: 5432
POSTGRES_HOST: localhost
POSTGRES_PASSWORD: somepassword
POSTGRES_USER: postgres
POSTGRES_DB: testing_db
DJANGO_SETTINGS_MODULE: pyarweb.settings.development
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install system libraries
run: |
sudo apt-get install -y libpq-dev libxml2-dev libxslt1-dev
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev_requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.txt
- name: Lint with flake8
- name: Check Code Style
uses: pre-commit/action@v3.0.1

- name: Check for Django migrations
run: |
flake8
python manage.py makemigrations --dry-run --check
- name: Run migrations
run: |
python manage.py migrate
- name: Run tests
run: |
python3 manage.py test -v2 --noinput
pytest -v
57 changes: 0 additions & 57 deletions .github/workflows/test.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/upload_to_dockerhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
release:
types: [published]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: my-docker-hub-namespace/my-docker-hub-repository

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile.prod
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: check-merge-conflict
- id: debug-statements

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
args:
- '--config=.flake8'
- '--exclude=.venv,**/migrations/*.py'

- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py39-plus]

- repo: https://github.com/adamchainz/django-upgrade
rev: "1.22.2"
hooks:
- id: django-upgrade
args: [--target-version, "3.2"]
20 changes: 1 addition & 19 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
# Código de conducta

Valoramos la participación de cada miembro de la comunidad Python y queremos que todos tengan una experiencia agradable y satisfactoria. En consecuencia, se espera que todos los contribuyentes de este proyecto sean respetuosos.

Para no dejar lugar a dudas, lo que se espera es que todos los contribuyentes de este repositorio cumplan el siguiente Código de Conducta. Los administradores serán responsables de fomentar el cumplimiento de este código.

Los administradores estarán encantado de ayudar a los participantes a que se sientan seguros y libres de acoso, por lo que si surgen problemas cubiertos por este código de conducta, por favor póngase en contacto con ellos escribiendo a coc@ac.python.org.ar.
Cualquier queja será confidencial, será tomado en serio, investigada y tratada adecuadamente.

Si un participante se involucra en comportamiento que viola el código de conducta, los administradores pueden tomar cualquier acción que consideren apropiadas, incluyendo advertencia al infractor o la expulsión.

Todos tienen derecho a ser tratados con cortesía, dignidad y respeto y estar libre de cualquier forma de discriminación, victimización, acoso o intimidación; como así también a disfrutar de un ambiente libre de comportamiento no deseado, lenguaje inapropiado e imágenes inadecuadas.

Está terminantemente prohibido el acoso. Entendiendo por éste, la comunicación ofensiva relacionada con el género, la orientación sexual, la discapacidad, la apariencia física, el tamaño corporal, la raza, la religión, las imágenes sexuales en espacios públicos, intimidación deliberada, acecho.

Sea amable con los demás: confiamos en que podrán tratar a los demás de una manera que refleja la opinión generalizada de que la diversidad y la amabilidad son los puntos fuertes de nuestra comunidad que se celebran y fomentan.

Tenga cuidado con las palabras que elija. Recuerde que los chistes de exclusión sexistas, racistas, y otros pueden ser ofensivos para quienes le rodean.


Por cualquier problema contactate con un administrador o escribí a coc@ac.python.org.ar
Este repositorio adhiere a los principios y el Código de Conducta de la Asociación Civil Python Argentina, accesibles online en: https://ac.python.org.ar/#coc. Se espera que todos los contribuyentes de este repositorio lo cumplan, y los mecanismos para reportar problemas son los que ofrece dicha asociación en la misma url. Los administradores serán responsables de fomentar el cumplimiento de este código.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM python:3.6
FROM python:3.9
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /code:$PYTHONPATH
RUN apt-get update && apt-get -y install flite
RUN apt-get update && apt-get -y install flite=2.2-5
RUN mkdir /code
WORKDIR /code
COPY dev_requirements.txt /code
COPY requirements.txt /code
RUN pip install -U pip
RUN pip install -r requirements.txt
RUN pip install -r dev_requirements.txt
COPY . /code/
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM python:3.6
FROM python:3.9
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /code:$PYTHONPATH
RUN apt-get update && apt-get -y install flite
RUN mkdir /code
WORKDIR /code
COPY prod_requirements.txt /code
COPY requirements.txt /code
RUN pip install -U pip
RUN pip install -r prod_requirements.txt
COPY . /code/
2 changes: 1 addition & 1 deletion INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Guia de instalación
## Guia de instalación

Seguí los pasos en nuestra wiki: https://github.com/PyAr/pyarweb/wiki/Instalacion-con-Docker
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ help:
@echo "bootstrap --build containers, run django migrations, load fixtures and create the a superuser"

start:
docker build -t pyarweb .
docker-compose up

stop:
Expand All @@ -22,11 +23,14 @@ clean: stop
docker-compose rm --force -v

only_test:
docker-compose run --rm web python3 ./manage.py test -v2 --noinput
docker-compose run --rm web /usr/local/bin/pytest -v

pep8:
docker-compose run --rm web flake8

format:
pre-commit run -a

test: pep8 only_test

dockershell:
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ instrucciones generales en [esta página de la wiki](https://github.com/PyAr/pya

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

## Lint & Format

Para correr el linter y el formateador de código, podés correr:

```bash
make format
```

## Más info

Expand Down
Loading

0 comments on commit 19661eb

Please sign in to comment.