Skip to content

Commit

Permalink
renovate build env, remove useless docs, prepare 5.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
lociii committed Jun 27, 2024
1 parent 35f46f6 commit 8f43cd2
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 953 deletions.
76 changes: 41 additions & 35 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,68 @@ on:
jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [
"3.9",
"3.10",
"3.11"
]
django-version: [
'>=3.2<4.0',
'>=4.1<4.2',
'>=4.2<5.0'
]
python-version:
- "3.10"
- "3.11"
- "3.12"
django:
- "4.2"
- "5.0"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

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

- name: Update pip
run: python -m pip install --upgrade pip

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Django 4.2
if: matrix.django == 4.2
run: pip install "Django>=4.2,<5.0"
- name: Install Django 5.0
if: matrix.django == 5.0
run: pip install "Django>=5.0,<5.1"

- name: Install dependencies
run: |
pip install -q "Django${{ matrix.django-version }}"
pip install .
pip install -r requirements-test.txt
- name: Install requirements
run: pip install -r requirements-test.txt

- name: Lint with flake8
run: flake8 --show-source
- name: Install package
run: pip install -e .

- name: Test
run: python manage.py test
- name: Lint with flake8
run: flake8 --show-source

- name: Run tests
run: python manage.py test

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
name: Build and publish to PyPI
name: Build and publish Python 🐍 distributions 📦 to PyPI
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: 3.12

- name: Install build packages
- name: Install deployment packages
run: python -m pip install -U setuptools wheel

- name: Build a binary wheel and a source tarball
run: python setup.py sdist bdist_wheel

- name: Publish Package on Pypi
- name: Publish Package on PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_SECRET }}

password: ${{ secrets.PYPI_API_TOKEN }}
16 changes: 6 additions & 10 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ Write Documentation
~~~~~~~~~~~~~~~~~~~

django_languageselect could always use more documentation, whether as part of the
official django_languageselect docs, in docstrings, or even on the web in blog posts,
articles, and such.
README, in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback
~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -98,17 +97,14 @@ Pull Request Guidelines
Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.7, 3.6, 3.7 and for PyPy. Check
https://travis-ci.org/RegioHelden/django-languageselect/pull_requests
and make sure that the tests pass for all supported Python versions.
2. If the pull request adds functionality, the README should be updated..
3. The PR must pass the CI tests.

Tips
----

To run a subset of tests::


$ python -m unittest tests.test_django_languageselect
```bash
python -m unittest tests.test_django_languageselect
```
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

ENV PYTHONUNBUFFERED 1
ENV LC_ALL=C.UTF-8
Expand Down Expand Up @@ -29,9 +29,8 @@ ENV PATH /home/app/venv/bin:${PATH}

RUN python3 -m venv ~/venv && \
pip install --upgrade pip && \
pip install wheel && \
pip install Django==3.2.1 && \
pip install -r requirements-test.txt
pip install -r requirements-test.txt && \
pip install Django==5.0.6

ADD . /app/

Expand Down
12 changes: 7 additions & 5 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
History
=======

Unreleased
==========

* Remove support for Python < 3.9
* Remove support for Django 4.0
5.0.0 (2024-06-27)
==================
* Remove support for Python below 3.10
* Remove support for Django below 4.2
* Add support for Django 5.0
* Add support for Python 3.11
* Add support for Python 3.12
* Modernize build and test environment

4.0.1 (2023-01-02)
Expand Down
87 changes: 0 additions & 87 deletions Makefile

This file was deleted.

34 changes: 23 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@ django_languageselect
.. image:: https://github.com/RegioHelden/django-languageselect/actions/workflows/build.yml/badge.svg
:target: https://github.com/RegioHelden/django-languageselect/actions

.. image:: https://readthedocs.org/projects/django-languageselect/badge/?version=latest
:target: https://django-languageselect.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


Simple language select as custom template tag


Requirements
============

Expand All @@ -27,8 +22,31 @@ Requirements
Usage:
======

To use django_languageselect in a project, add it to `INSTALLED_APP`

```python
INSTALLED_APP = [
*INSTALLED_APP,
'django_languageselect',
]
```

Add this to your urls.py

```python
urlpatterns = [
*urlpatterns,
url(r'^languageselect/', include('django_languageselect.urls')),
]
```

Use the languageselect tag where you which to show languages list:

```jinja
{% load languageselect %}
{% languageselect %}
```

Routes:
=======
Expand All @@ -38,7 +56,6 @@ Customization

Feel free to use your own template, just add languageselect/layer.html


* Free software: MIT license
* Documentation: https://django-languageselect.readthedocs.io.

Expand All @@ -49,11 +66,6 @@ Tests will be automatically run by travis on commit to master.

They can also be executed locally using docker-compose by running `docker-compose up`

Requirements upgrades
=====================

Check for upgradeable packages by running `docker-compose run --rm python pip-check`

Making a new release
====================

Expand Down
3 changes: 0 additions & 3 deletions docs/.gitignore

This file was deleted.

Loading

0 comments on commit 8f43cd2

Please sign in to comment.