Skip to content

Commit

Permalink
CI updates and other tweaks (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
cobusc committed Dec 30, 2022
1 parent acb0500 commit 606a7c2
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 13 deletions.
66 changes: 61 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,88 @@ sudo: true
language: python
jobs:
include:
# https://docs.djangoproject.com/en/4.1/releases/2.2/
- env: DJANGO_VERSION=2.2
python: "3.5"
dist: xenial
- env: DJANGO_VERSION=2.2
python: "3.6"
- env: DJANGO_VERSION=2.2
python: "3.7"
dist: xenial
- env: DJANGO_VERSION=2.2
python: "3.8"
dist: xenial
- env: DJANGO_VERSION=2.2
python: "3.9"
dist: xenial
# https://docs.djangoproject.com/en/4.1/releases/3.0/
- env: DJANGO_VERSION=3.0
python: "3.6"
dist: bionic
- env: DJANGO_VERSION=3.0
python: "3.7"
dist: bionic
- env: DJANGO_VERSION=3.0
python: "3.8"
dist: bionic
- env: DJANGO_VERSION=3.0
python: "3.9"
dist: bionic
# https://docs.djangoproject.com/en/4.1/releases/3.1/
- env: DJANGO_VERSION=3.1
python: "3.6"
dist: bionic
- env: DJANGO_VERSION=3.1
python: "3.7"
dist: bionic
- env: DJANGO_VERSION=3.1
python: "3.8"
dist: bionic
- env: DJANGO_VERSION=3.1
python: "3.9"
dist: bionic
# https://docs.djangoproject.com/en/4.1/releases/3.2/
- env: DJANGO_VERSION=3.2
python: "3.6"
dist: bionic
- env: DJANGO_VERSION=3.2
python: "3.7"
dist: bionic
- env: DJANGO_VERSION=3.2
python: "3.8"
dist: bionic
- env: DJANGO_VERSION=3.2
python: "3.9"
dist: bionic
- env: DJANGO_VERSION=3.2
python: "3.10"
dist: bionic
# https://docs.djangoproject.com/en/4.1/releases/4.0/
- env: DJANGO_VERSION=4.0
python: "3.8"
dist: jammy
- env: DJANGO_VERSION=4.0
python: "3.9"
- env: DJANGO_VERSION=4.0
python: "3.10"
dist: jammy
# Removed due to python dependency issue
# - env: DJANGO_VERSION=4.0
# python: "3.10"
# dist: jammy
# https://docs.djangoproject.com/en/4.1/releases/4.1/
- env: DJANGO_VERSION=4.1
python: "3.8"
dist: jammy
- env: DJANGO_VERSION=4.1
python: "3.9"
dist: jammy
# Removed due to python dependency issue
# - env: DJANGO_VERSION=4.1
# python: "3.10"
# dist: jammy
- env: DJANGO_VERSION=4.1
python: "3.11"
dist: jammy


addons:
Expand All @@ -36,10 +92,10 @@ addons:
- nginx

install:
- sudo ln -s tests/ngingx.conf /etc/nginx/sites-enabled/
- sudo cp tests/nginx.conf /etc/nginx/
- sudo service nginx reload
- pip install -q Django==$DJANGO_VERSION
- python setup.py -q install
- pip install --upgrade setuptools importlib-metadata pip
- pip install -q Django==$DJANGO_VERSION .

script:
- make test
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test:
- pip install nose
DJANGO_SETTINGS_MODULE=tests.settings nosetests
- pip install pytest
DJANGO_SETTINGS_MODULE=tests.settings pytest

publish:
- rm dist/*
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![Build Status](https://www.travis-ci.org/cobusc/django-protected-media.svg?branch=master)
[![Build Status](https://app.travis-ci.com/cobusc/django-protected-media.svg?branch=master)](https://app.travis-ci.com/cobusc/django-protected-media)


Django Protected Media
Expand Down
9 changes: 6 additions & 3 deletions protected_media/settings.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from django.conf import settings

# Filesystem location to store protected media
if not hasattr(settings, "PROTECTED_MEDIA_ROOT") and not hasattr(settings, "BASE_DIR"):
raise RuntimeError("The default value for PROTECTED_MEDIA_ROOT requires BASE_DIR to be an available setting.")

# Filesystem location to store protected media.
PROTECTED_MEDIA_ROOT = getattr(
settings, "PROTECTED_MEDIA_ROOT", "%s/protected/" % settings.BASE_DIR
settings, "PROTECTED_MEDIA_ROOT", "%s/protected/" % settings.BASE_DIR
)

# The URL prefix used by protected media
PROTECTED_MEDIA_URL = getattr(
settings, "PROTECTED_MEDIA_URL", "protected/"
settings, "PROTECTED_MEDIA_URL", "/protected/"
)

# An alternative prefix to use with servers like Nginx, where we want to
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='django-protected-media',
version='1.0.1',
version='1.0.2',
packages=find_packages(),
include_package_data=True,
license='BSD License',
Expand All @@ -26,6 +26,7 @@
'Framework :: Django :: 3.0',
'Framework :: Django :: 3.1',
'Framework :: Django :: 4.0',
'Framework :: Django :: 4.1',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
Expand Down
2 changes: 1 addition & 1 deletion tests/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error_log /tmp/error.log;
worker_processes 10;
pid /tmp/nginx.pid;
pid /run/nginx.pid;

events {
worker_connections 768;
Expand Down

0 comments on commit 606a7c2

Please sign in to comment.