Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Updates #2

Merged
merged 9 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
# Move to pyproject.toml after: https://gitlab.com/pycqa/flake8/-/issues/428
#
[flake8]
exclude = .pytest_cache, .tox, dist, htmlcov, */migrations/*
exclude = .*, local_test, dist, htmlcov, */migrations/*
#ignore = E402
max-line-length = 119
31 changes: 19 additions & 12 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,48 @@
name: pytest
# https://github.com/actions/setup-python

name: Test

on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'
push:

jobs:
test:
runs-on: ubuntu-latest
name: 'Python ${{ matrix.python-version }} on ${{ matrix.os }}'
runs-on: ${{ matrix.os }}
env:
PYTHONUNBUFFERED: 1
strategy:
max-parallel: 2
fail-fast: false
matrix:
python-version: [3.9, 3.8, 3.7]
os: [ubuntu-latest] # TODO: macOS-latest, windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: 'Set up Python ${{ matrix.python-version }}'
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '${{ matrix.python-version }}'

- name: 'Install package'
- name: 'Bootstrap'
run: |
pip3 install poetry
make install
python3 devshell.py quit

- name: 'List installed packages'
run: |
poetry run pip freeze
python3 devshell.py list_venv_packages

- name: 'Run tests with Python v${{ matrix.python-version }}'
run: |
make pytest
python3 devshell.py pytest -vv

- name: 'Upload coverage report'
if: matrix.os == 'ubuntu-latest'
run: bash <(curl -s https://codecov.io/bash)

- name: 'Run linters'
if: matrix.python-version == '3.8'
run: |
make lint
python3 devshell.py linting
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ secret.txt
/htmlcov/
/local_test/
/dist/
/poetry.lock
*.log
61 changes: 0 additions & 61 deletions Makefile

This file was deleted.

84 changes: 56 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ LOGOUT_REDIRECT_URL = '/yunohost/sso/'

## local test

### Build prerequisites

We install `psycopg2` (a PostgreSQL adapter for the Python) that needs some build prerequisites, e.g.:

```bash
~$ sudo apt install build-essential python3-dev libpq-dev
```

For quicker developing of django_yunohost_integration in the context of YunoHost app,
it's possible to run the Django developer server with the settings
and urls made for YunoHost installation.
Expand All @@ -93,25 +101,44 @@ e.g.:
```bash
~$ git clone https://github.com/jedie/django_yunohost_integration.git
~$ cd django_yunohost_integration/
~/django_yunohost_integration$ make
install-poetry install or update poetry
install install project via poetry
update update the sources and installation and generate "conf/requirements.txt"
lint Run code formatters and linter
fix-code-style Fix code formatting
tox-listenvs List all tox test environments
tox Run pytest via tox with all environments
pytest Run pytest
publish Release new version to PyPi
local-test Run local_test.py to run the project locally
local-diff-settings Run "manage.py diffsettings" with local test

~/django_yunohost_integration$ make install-poetry
~/django_yunohost_integration$ make install
~/django_yunohost_integration$ make local-test
~/django_yunohost_integration$ ./devshell.py

+ .venv/bin/python .venv/bin/devshell



Developer shell - django_yunohost_integration - v0.2.0


Documented commands (use 'help -v' for verbose/'help <topic>' for details):

dev-shell commands
==================
fix_code_style linting list_venv_packages publish pytest update


Django-YunoHost-Integration commands
====================================
local_test

Uncategorized
=============
alias help macro run_pyscript set shortcuts
edit history quit run_script shell


(django_yunohost_integration)
```

Notes:
For quicker developing of django_yunohost_integration in the context of YunoHost app,
it's possible to run the Django developer server with the settings
and urls made for YunoHost installation.

e.g.:
```bash
~/django_yunohost_integration$ ./devshell.py
(django_yunohost_integration) local_test
```

* SQlite database will be used
* A super user with username `test` and password `test` is created
Expand All @@ -120,34 +147,35 @@ Notes:

## history

* [compare v0.1.5...master](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/v0.1.5...master) **dev**
* [compare v0.2.0...master](https://github.com/jedie/django_yunohost_integration/compare/v0.2.0...master) **dev**
* tbc
* v0.2.0.alpha0 **dev**
* [v0.2.0 - 15.09.2021](https://github.com/jedie/django_yunohost_integration/compare/v0.1.5...v0.2.0)
* rename/split `django_ynh` into:
* `django_yunohost_integration` - Python package with the glue code to integrate a Django project with YunoHost
* `django_example_ynh` - Demo YunoHost App to demonstrate the integration of a Django project under YunoHost
* [v0.1.5 - 19.01.2021](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/v0.1.4...v0.1.5)
* Replace `psycopg2-binary` with `psycopg2` (needs some prerequisites packages, see above)
* [v0.1.5 - 19.01.2021](https://github.com/jedie/django_yunohost_integration/compare/v0.1.4...v0.1.5)
* Make some deps `gunicorn`, `psycopg2-binary`, `django-redis`, `django-axes` optional
* [v0.1.4 - 08.01.2021](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/v0.1.3...v0.1.4)
* Bugfix [CSRF verification failed on POST requests #7](https://github.com/YunoHost-Apps/django_yunohost_integration/issues/7)
* [v0.1.3 - 08.01.2021](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/v0.1.2...v0.1.3)
* [v0.1.4 - 08.01.2021](https://github.com/jedie/django_yunohost_integration/compare/v0.1.3...v0.1.4)
* Bugfix: CSRF verification failed on POST requests
* [v0.1.3 - 08.01.2021](https://github.com/jedie/django_yunohost_integration/compare/v0.1.2...v0.1.3)
* set "DEBUG = True" in local_test (so static files are served and auth works)
* Bugfixes and cleanups
* [v0.1.2 - 29.12.2020](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/v0.1.1...v0.1.2)
* [v0.1.2 - 29.12.2020](https://github.com/jedie/django_yunohost_integration/compare/v0.1.1...v0.1.2)
* Bugfixes
* [v0.1.1 - 29.12.2020](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/v0.1.0...v0.1.1)
* [v0.1.1 - 29.12.2020](https://github.com/jedie/django_yunohost_integration/compare/v0.1.0...v0.1.1)
* Refactor "create_superuser" to a manage command, useable via "django_yunohost_integration" in `INSTALLED_APPS`
* Generate "conf/requirements.txt" and use this file for install
* rename own settings and urls (in `/conf/`)
* [v0.1.0 - 28.12.2020](https://github.com/YunoHost-Apps/django_yunohost_integration/compare/f578f14...v0.1.0)
* [v0.1.0 - 28.12.2020](https://github.com/jedie/django_yunohost_integration/compare/f578f14...v0.1.0)
* first working state
* [23.12.2020](https://github.com/YunoHost-Apps/django_yunohost_integration/commit/f578f144a3a6d11d7044597c37d550d29c247773)
* [23.12.2020](https://github.com/jedie/django_yunohost_integration/commit/f578f144a3a6d11d7044597c37d550d29c247773)
* init the project


## Links

* Report a bug about this package: https://github.com/YunoHost-Apps/django_yunohost_integration
* Report a bug about this package: https://github.com/jedie/django_yunohost_integration
* YunoHost website: https://yunohost.org/
* PyPi package: https://pypi.org/project/django_yunohost_integration/

Expand Down
Loading