Skip to content

Commit

Permalink
Merge pull request #32 from jazzband/gha
Browse files Browse the repository at this point in the history
Migrate to GitHub Actions.
  • Loading branch information
jezdez authored Jan 30, 2021
2 parents 41a0379 + 1ba07a2 commit 147960f
Show file tree
Hide file tree
Showing 14 changed files with 312 additions and 194 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
source = flatblocks
branch = 1

[report]
omit = *tests*,*migrations*,.tox/*,setup.py,*settings.py
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
if: github.repository == 'jazzband/django-flatblocks'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: release-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
release-
- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
twine check dist/*
- name: Upload packages to Jazzband
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: jazzband
password: ${{ secrets.JAZZBAND_RELEASE_KEY }}
repository_url: https://jazzband.co/projects/django-flatblocks/upload
52 changes: 52 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test

on: [push, pull_request]

jobs:
build:
name: build (Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']
django-version: ['2.2', '3.0', '3.1', 'dev']

steps:
- uses: actions/checkout@v2

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

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions
- name: Tox tests
run: |
tox -v
env:
DJANGO: ${{ matrix.django-version }}

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ local_settings.py
django_flatblocks.egg-info
dist
build
.tox
coverage.xml
.coverage
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
django-flatblocks
=================

.. image:: https://jazzband.co/static/img/badge.svg
:target: https://jazzband.co/
:alt: Jazzband

.. image:: https://github.com/jazzband/django-flatblocks/workflows/Test/badge.svg
:target: https://github.com/jazzband/django-flatblocks/actions
:alt: GitHub Actions

.. image:: https://codecov.io/gh/jazzband/django-flatblocks/branch/master/graph/badge.svg
:target: https://codecov.io/gh/jazzband/django-flatblocks

django-flatblocks is a simple application for handling small text-blocks on
websites. Think about it like ``django.contrib.flatpages`` just not for a
whole page but for only parts of it, like an information text describing what
Expand Down Expand Up @@ -202,6 +213,15 @@ the `django-better-chunks`_ fork (``django.contrib.site``- and i18n-support).
Releases
--------

Unreleased:
* Support for Django 2.2, 3.0 and 3.1.
* Support for Python 3.6, 3.7, 3.8 and 3.9.
* Moved CI to GitHub Actions: https://github.com/jazzband/django-flatblocks/actions

0.9.4:
* Drop Python 3.3 support.
* Add support for Django 1.11.

0.9.3:
* Fixed Django 1.10 compatibility

Expand Down
7 changes: 7 additions & 0 deletions flatblocks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_distribution("django-flatblocks").version
except DistributionNotFound:
# package is not installed
__version__ = None
6 changes: 2 additions & 4 deletions flatblocks/urls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from django.conf.urls import url
from django.contrib.admin.views.decorators import staff_member_required
from django.urls import re_path
from flatblocks.views import edit

urlpatterns = [
url('^edit/(?P<pk>\d+)/$',
staff_member_required(edit),
name='flatblocks-edit'),
re_path("^edit/(?P<pk>\d+)/$", staff_member_required(edit), name="flatblocks-edit"),
]
56 changes: 0 additions & 56 deletions runtests.py

This file was deleted.

77 changes: 39 additions & 38 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,51 +1,52 @@
import io

from setuptools import setup, find_packages


setup(
name='django-flatblocks',
version='0.9.4',
description='django-flatblocks acts like django.contrib.flatpages but '
'for parts of a page; like an editable help box you want '
'show alongside the main content.',
long_description=io.open('README.rst', encoding='utf-8').read(),
keywords='django apps',
license='New BSD License',
author='Horst Gutmann, Curtis Maloney',
author_email='[email protected]',
url='http://github.com/funkybob/django-flatblocks/',
name="django-flatblocks",
use_scm_version={"version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
description="django-flatblocks acts like django.contrib.flatpages but "
"for parts of a page; like an editable help box you want "
"show alongside the main content.",
long_description=io.open("README.rst", encoding="utf-8").read(),
keywords="django apps",
license="New BSD License",
author="Horst Gutmann, Curtis Maloney",
author_email="[email protected]",
url="https://github.com/jazzband/django-flatblocks/",
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Plugins',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 2.2',
'Framework :: Django :: 3.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
"Development Status :: 4 - Beta",
"Environment :: Plugins",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 2.2",
"Framework :: Django :: 3.0",
"Framework :: Django :: 3.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
],
packages=find_packages(exclude=['tests']),
packages=find_packages(exclude=["tests"]),
package_data={
'flatblocks': [
'templates/flatblocks/*.html',
'locale/*/*/*.mo',
'locale/*/*/*.po',
"flatblocks": [
"templates/flatblocks/*.html",
"locale/*/*/*.mo",
"locale/*/*/*.po",
]
},
zip_safe=False,
requires = [
'Django (>=2.2)',
requires=[
"Django (>=2.2)",
],
)
Loading

0 comments on commit 147960f

Please sign in to comment.