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

Migrate to GitHub Actions. #197

Closed
wants to merge 14 commits into from
Closed
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
46 changes: 0 additions & 46 deletions .circleci/config.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/main.yml

This file was deleted.

40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
tags:
- '*'

jobs:
build:
if: github.repository == 'jazzband/dj-rest-auth'
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: 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/dj-rest-auth/upload
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9']

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 Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade tox tox-gh-actions

- name: Tox tests
run: |
tox -v

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
name: Python ${{ matrix.python-version }}
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Dj-Rest-Auth
[![<iMerica>](https://circleci.com/gh/jazzband/dj-rest-auth.svg?style=svg)](https://app.circleci.com/pipelines/github/jazzband/dj-rest-auth)
[![GitHub Actions](https://github.com/jazzband/dj-rest-auth/workflows/Test/badge.svg)](https://github.com/jazzband/dj-rest-auth/actions)
[![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/)
[![Coverage Status](https://coveralls.io/repos/github/jazzband/dj-rest-auth/badge.svg?branch=master)](https://coveralls.io/github/jazzband/dj-rest-auth?branch=master)
[![Coverage Status](https://codecov.io/gh/jazzband/dj-rest-auth/branch/master/graph/badge.svg)](https://codecov.io/gh/jazzband/dj-rest-auth)

Drop-in API endpoints for handling authentication securely in Django Rest Framework. Works especially well
with SPAs (e.g React, Vue, Angular), and Mobile applications.
Expand Down Expand Up @@ -46,14 +46,7 @@ JWT_AUTH_COOKIE = 'jwt-auth'

### Testing

To run the tests within a virtualenv, run `python runtests.py` from the repository directory.
The easiest way to run test coverage is with [`coverage`](https://pypi.org/project/coverage/),
which runs the tests against all supported Django installs. To run the test coverage
within a virtualenv, run `coverage run ./runtests.py` from the repository directory then run `coverage report`.

#### Tox

Testing may also be done using [`tox`](https://pypi.org/project/tox/), which
Testing is done using [`tox`](https://pypi.org/project/tox/), which
will run the tests against all supported combinations of python and django.

Install tox, either globally or within a virtualenv, and then simply run `tox`
Expand Down
15 changes: 15 additions & 0 deletions dj_rest_auth/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
__title__ = "dj-rest-auth"
__description__ = "Authentication and Registration in Django Rest Framework."
__url__ = "http://github.com/jazzband/dj-rest-auth"
__author__ = "@iMerica https://github.com/iMerica"
__author_email__ = "imichael@pm.me"
__license__ = "MIT"
__copyright__ = "Copyright 2020 @iMerica https://github.com/iMerica"

from pkg_resources import get_distribution, DistributionNotFound

try:
__version__ = get_distribution("dj-rest-auth").version
except DistributionNotFound:
# package is not installed
__version__ = None
8 changes: 0 additions & 8 deletions dj_rest_auth/__version__.py

This file was deleted.

6 changes: 0 additions & 6 deletions dj_rest_auth/tests/requirements.pip

This file was deleted.

14 changes: 4 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import os
import sys

about = {}
with open('../dj_rest_auth/__version__.py', 'r', encoding="utf8") as f:
exec(f.read(), about)
from pkg_resources import get_distribution

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -54,10 +49,9 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = about['__version__']
# The full version, including alpha/beta/rc tags.
release = about['__version__']
release = get_distribution('dj-rest-auth').version
# for example take major/minor
version = '.'.join(release.split('.')[:2])

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
6 changes: 1 addition & 5 deletions docs/disclosure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ Some basic rules:

- Keep it legal.
- Respect everyone's privacy.
- Contact the core maintainer(s) immediately if you discover a serious security vulnerability (imichael@pm.me for now).




- Contact the core maintainer(s) immediately if you discover a serious security vulnerability (security@jazzband.co).
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ Welcome to dj-rest-auth's documentation!

.. note:: dj-rest-auth version 1.0.0 now uses Django Simple JWT.


.. image:: https://circleci.com/gh/jazzband/dj-rest-auth.svg?style=svg
:target: https://circleci.com/gh/jazzband/dj-rest-auth
.. image:: https://github.com/jazzband/dj-rest-auth/workflows/Test/badge.svg
:target: https://github.com/jazzband/dj-rest-auth/actions
:alt: GitHub Actions

Contents
--------
Expand Down
26 changes: 0 additions & 26 deletions runtests.py

This file was deleted.

15 changes: 2 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@
f.close()


about = {}
with open('dj_rest_auth/__version__.py', 'r', encoding="utf8") as f:
exec(f.read(), about)

setup(
name='dj-rest-auth',
version=about['__version__'],
use_scm_version={"version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
author='iMerica',
author_email='imichael@pm.me',
url='http://github.com/jazzband/dj-rest-auth',
Expand All @@ -33,14 +30,6 @@
extras_require={
'with_social': ['django-allauth>=0.40.0,<0.43.0'],
},
tests_require=[
'coveralls>=1.11.1'
'django-allauth==0.42.0',
'djangorestframework-simplejwt==4.6.0',
'responses==0.12.1',
'unittest-xml-reporting==3.0.4',
],
test_suite='runtests.runtests',
include_package_data=True,
python_requires='>=3.5',
classifiers=[
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
django-allauth==0.42.0
djangorestframework-simplejwt>=4.4.0
flake8==3.8.4
responses==0.12.1
5 changes: 1 addition & 4 deletions dj_rest_auth/tests/settings.py → tests/settings.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import logging
import os
import sys

PROJECT_ROOT = os.path.abspath(os.path.split(os.path.split(__file__)[0])[0])


logging.disable(logging.CRITICAL)
ROOT_URLCONF = 'urls'
ROOT_URLCONF = 'tests.urls'
STATIC_URL = '/static/'
STATIC_ROOT = '%s/staticserve' % PROJECT_ROOT
STATICFILES_DIRS = (
Expand All @@ -19,7 +18,6 @@
IS_DEV = False
IS_STAGING = False
IS_PROD = False
IS_TEST = 'test' in sys.argv or 'test_coverage' in sys.argv

DATABASES = {
'default': {
Expand Down Expand Up @@ -72,7 +70,6 @@
)
}

TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
TEST_OUTPUT_DIR = 'test-results'

INSTALLED_APPS = [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def validate_is_lower(username: str):


custom_username_validators = [validate_is_lower]
validator_path = "dj_rest_auth.tests.test_serializers.custom_username_validators"
validator_path = "tests.test_serializers.custom_username_validators"


class TestUserDetailsSerializer(TestCase):
Expand Down
File renamed without changes.
File renamed without changes.
Loading