Skip to content

Commit

Permalink
Project level changes
Browse files Browse the repository at this point in the history
* Using poetry to manage the project
* Using github workflows
* Added isort to pre-commit
  • Loading branch information
vinayinvicible committed Aug 27, 2022
1 parent 337571e commit 8ffd3fe
Show file tree
Hide file tree
Showing 17 changed files with 1,329 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ serialize =
{major}.{minor}.{patch}{release}
{major}.{minor}.{patch}

[bumpversion:file:django_route/__init__.py]
[bumpversion:file:pyproject.toml]
49 changes: 49 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: test
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version:
- '3.8'
- '3.9'
- '3.10'
toxenv:
- 'django32'
- 'django40'
- 'django41'
include:
- python-version: '3.6'
django-version: 'django32'
os: [ubuntu-latest]
- python-version: '3.7'
django-version: 'django32'
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install and upgrade packaging tools
run: python -m pip install --upgrade pip codecov tox
- name: Run tests
run: tox
env:
TOXENV: ${{ matrix.toxenv }}
- name: Upload coverage report
run: codecov
7 changes: 0 additions & 7 deletions .isort.cfg

This file was deleted.

5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ repos:
rev: 22.6.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--filter-files"]
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.3.0
hooks:
Expand Down
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

6 changes: 0 additions & 6 deletions django_route/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
import django

__version__ = "0.2.0"

if django.VERSION < (3, 2):
default_app_config = "django_route.apps.DjangoRouteConfig"
17 changes: 7 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@
# documentation root, use os.path.abspath to make it absolute, like shown here.

import inspect
import os
import sys

sys.path.insert(0, os.path.abspath("..")) # noqa
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") # noqa

import django_route # noqa
import pkg_resources

# -- General configuration ------------------------------------------------

Expand Down Expand Up @@ -66,9 +61,9 @@
# built documents.
#
# The short X.Y version.
version = django_route.__version__
version = pkg_resources.get_distribution("django-route").version
# The full version, including alpha/beta/rc tags.
release = django_route.__version__
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -311,7 +306,9 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "django-route", "django-route Documentation", [author], 1)]
man_pages = [
(master_doc, "django-route", "django-route Documentation", [author], 1),
]

# If true, show URL addresses after external links.
#
Expand Down Expand Up @@ -355,8 +352,8 @@

django.setup()

from django.utils.html import strip_tags # noqa
from django.utils.encoding import force_str # noqa
from django.utils.html import strip_tags # noqa


def process_docstring(app, what, name, obj, options, lines):
Expand Down
8 changes: 2 additions & 6 deletions fabfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fabric.api import task, local
from fabric.api import local, task


@task
Expand All @@ -8,7 +8,6 @@ def clean():

@task
def bump_version(part="patch"):
local("pip install --upgrade bumpversion")
local("bumpversion {}".format(part))
local("git push")
local("git push --tags")
Expand All @@ -23,7 +22,4 @@ def release(part="patch"):
@task
def pypi():
clean()
local("pip install --upgrade wheel")
local("python setup.py clean")
local("python setup.py sdist bdist_wheel")
local("twine upload dist/*")
local("poetry publish --build")
Loading

0 comments on commit 8ffd3fe

Please sign in to comment.