Skip to content

Commit

Permalink
Merge pull request #87 from miki725/pre-commit
Browse files Browse the repository at this point in the history
adding pre-commit to the repo
  • Loading branch information
miki725 authored Nov 3, 2019
2 parents aa83ae1 + c1bae85 commit 4bd2bb2
Show file tree
Hide file tree
Showing 60 changed files with 1,638 additions and 1,767 deletions.
81 changes: 14 additions & 67 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,80 +1,27 @@
kind: pipeline
name: pr
name: tests

steps:
- name: python3.7
image: python:3.7
commands:
- pip install tox
- tox -e $(tox -l | grep py37 | paste -sd ",")
environment:
ADDITIONAL_COVERAGE_FLAGS: --cov-report=xml
- name: lint
image: miki725/pre-commit
depends_on:
- clone

- name: python3.6
image: python:3.6
- name: python3.8
image: python:3.8
commands:
- pip install tox
- tox -e $(tox -l | grep py36 | paste -sd ",")
depends_on:
- clone

- name: python2.7
image: python:2.7
commands:
- pip install tox
- tox -e $(tox -l | grep py27 | paste -sd ",")
depends_on:
- clone

- name: pypy
image: pypy:2.7
commands:
- pip install tox
- tox -e $(tox -l | grep pypy- | paste -sd ",")
depends_on:
- clone

- name: pypy3
image: pypy:3.6
commands:
- pip install tox
# ignore django latest as pypy3.6 does not have updated sqlite yet
# and django fails to correctly create db in earlier sqlite versions
# >>> sqlite3.sqlite_version_info
# (3, 16, 2)
- tox -e $(tox -l | grep pypy3- | grep -v latest | paste -sd ",")
- tox -e $(tox -l | grep py38 | paste -sd ",")
environment:
ADDITIONAL_COVERAGE_FLAGS: --cov-report=xml
depends_on:
- clone

- name: coverage
image: plugins/codecov
settings:
token:
from_secret: codecov_token
files:
- '*.xml'
required: true
depends_on:
- python3.7

trigger:
event:
- pull_request

---
kind: pipeline
name: master

steps:
- name: python3.7
image: python:3.7
commands:
- pip install tox
- tox -e $(tox -l | grep py37 | paste -sd ",")
environment:
ADDITIONAL_COVERAGE_FLAGS: --cov-report=xml
depends_on:
- clone

Expand Down Expand Up @@ -123,21 +70,21 @@ steps:
- '*.xml'
required: true
depends_on:
- python3.7
- python3.8

trigger:
event:
- push
branch:
- master
trigger:
ref:
- refs/heads/master
- refs/pull/*/head

---
kind: pipeline
name: release

steps:
- name: release
image: python:3.7
image: python:3.8
environment:
TWINE_USERNAME:
from_secret: pypi_username
Expand Down
1 change: 1 addition & 0 deletions .importanizerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"exclude": [
"*/.tox/*"
],
"length": 96,
"groups": [
{
"type": "stdlib"
Expand Down
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'master'
hooks:
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-byte-order-marker
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: pretty-format-json
args: [--autofix, --indent=2]
- id: check-merge-conflict
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents]
- id: debug-statements
- id: end-of-file-fixer
- id: fix-encoding-pragma
- id: flake8
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/miki725/importanize
rev: 'master'
hooks:
- id: importanize
language_version: python3

- repo: https://github.com/python/black
rev: 'master'
hooks:
- id: black
args: [--line-length=88, --safe]
language_version: python3
exclude: test_data/.*$
9 changes: 9 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
History
-------

0.3.14 (2019-10-30)
~~~~~~~~~~~~~~~~~~~

* Using ``CharField`` for ``regex`` filters.
See `#90 <https://github.com/miki725/django-url-filter/pull/90>`_.
* ``SQLAlchemyFilterBackend`` does not join models if already join path
is partially joined already.
* ``SQLAlchemyFilterBackend`` joins when ``selectinjoin`` is used.

0.3.13 (2019-07-28)
~~~~~~~~~~~~~~~~~~~

Expand Down
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ clean-test: ## remove test and coverage artifacts
clean-test-all: clean-test ## remove all test-related artifacts including tox
rm -rf .tox/

importanize:
importanize --ci

lint: ## check style with flake8
flake8 .
if python -c "import sys; exit(1) if sys.version[:3] < '3.6' else exit(0)"; \
lint: ## lint whole library
if python -c "import sys; exit(1) if sys.version[:3] < '3.6' or getattr(sys, 'pypy_version_info', None) else exit(0)"; \
then \
make importanize ; \
pre-commit run --all-files ; \
fi

test: ## run tests quickly with the default Python
Expand Down
1 change: 0 additions & 1 deletion docs/api/url_filter.backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Submodules
url_filter.backends.django
url_filter.backends.plain
url_filter.backends.sqlalchemy

1 change: 0 additions & 1 deletion docs/api/url_filter.filtersets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ Submodules
url_filter.filtersets.django
url_filter.filtersets.plain
url_filter.filtersets.sqlalchemy

1 change: 0 additions & 1 deletion docs/api/url_filter.integrations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ Submodules

url_filter.integrations.drf
url_filter.integrations.drf_coreapi

1 change: 0 additions & 1 deletion docs/api/url_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ Submodules
url_filter.filters
url_filter.utils
url_filter.validators

65 changes: 34 additions & 31 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
import sphinx_rtd_theme


os.environ['DJANGO_SETTINGS_MODULE'] = 'test_project.settings'
os.environ["DJANGO_SETTINGS_MODULE"] = "test_project.settings"

# 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
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.dirname(os.path.abspath('.')))
sys.path.insert(0, os.path.dirname(os.path.abspath(".")))


getattr(django, 'setup', bool)()
getattr(django, "setup", bool)()

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

Expand All @@ -36,39 +36,35 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
]
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The encoding of source files.
# source_encoding = 'utf-8-sig'

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = 'Django URL Filter'
copyright = '2015, Miroslav Shubernetskiy'
author = 'Miroslav Shubernetskiy'
project = "Django URL Filter"
copyright = "2015, Miroslav Shubernetskiy"
author = "Miroslav Shubernetskiy"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.1'
version = "0.1"
# The full version, including alpha/beta/rc tags.
release = '0.1'
release = "0.1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -85,7 +81,7 @@

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ['_build']
exclude_patterns = ["_build"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand All @@ -103,7 +99,7 @@
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -119,7 +115,7 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -148,7 +144,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -211,20 +207,17 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'DjangoURLFilterdoc'
htmlhelp_basename = "DjangoURLFilterdoc"

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
# 'preamble': '',

# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
Expand All @@ -233,8 +226,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'DjangoURLFilter.tex', 'Django URL Filter Documentation',
'Miroslav Shubernetskiy', 'manual'),
(
master_doc,
"DjangoURLFilter.tex",
"Django URL Filter Documentation",
"Miroslav Shubernetskiy",
"manual",
)
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -263,8 +261,7 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'djangourlfitler', 'Django URL Filter Documentation',
[author], 1)
(master_doc, "djangourlfitler", "Django URL Filter Documentation", [author], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -277,9 +274,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'DjangoURLFilter', 'Django URL Filter Documentation',
author, 'DjangoURLFilter', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"DjangoURLFilter",
"Django URL Filter Documentation",
author,
"DjangoURLFilter",
"One line description of project.",
"Miscellaneous",
)
]

# Documents to append as an appendix to all manuals.
Expand Down
1 change: 1 addition & 0 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys

Expand Down
Loading

0 comments on commit 4bd2bb2

Please sign in to comment.