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

Cleanup #132

Merged
merged 9 commits into from
Oct 3, 2018
Merged
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
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

41 changes: 30 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,21 +1,40 @@
# EditorConfig is awesome: http://EditorConfig.org
# EditorConfig Configurtaion file, for more details see:
# http://EditorConfig.org
# EditorConfig is a convention description, that could be interpreted
# by multiple editors to enforce common coding conventions for specific
# file types

# top-most EditorConfig file
# top-most EditorConfig file:
# Will ignore other EditorConfig files in Home directory or upper tree level.
root = true

[*]

; See https://github.com/editorconfig/editorconfig/issues/226
;end_of_line = lf

[*] # For All Files
# Unix-style newlines with a newline ending every file
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Set default charset
charset = utf-8
# Indent style default
indent_style = space
# Max Line Length - a hard line wrap, should be disabled
max_line_length = off

[*.{py,cfg,ini}]
# 4 space indentation
[*.py]
indent_style = space
indent_size = 4

; Tab indentation (no size specified)
[*.js]
indent_style = tab
[*.{yml}]
# 2 space indentation
indent_size = 2

[*.{js}]
# Tab indentation (no size specified)
indent_style = tab

[{Makefile,.gitmodules}]
# Tab indentation (no size specified, but view as 4 spaces)
indent_style = tab
indent_size = unset
tab_width = unset
19 changes: 0 additions & 19 deletions .flake8

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ debug.log
wsgidav.conf
wsgidav.json
dist
coverage.xml
.coverage*

*.prefs
*.project
Expand Down
6 changes: 0 additions & 6 deletions .isort.cfg

This file was deleted.

48 changes: 37 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,47 @@
sudo: false
language: python
python:
- "2.7"
# - "3.3" # End-of-life September 2017
- "3.4"
- "3.5"
- "3.6"
# See yaml/pyyaml#126.
# - "3.7-dev" # Planned for 2018-06

#sudo: required
matrix:
include:
- python: "2.7"
env: TOXENV=lint-py27
- python: "3.6"
env: TOXENV=black-check,lint-py36
- python: "2.7"
env: TOXENV=py27
- python: "3.4"
env: TOXENV=py34
- python: "3.5"
env: TOXENV=py35
- python: "3.6"
env: TOXENV=py36
- python: "3.7"
env: TOXENV=py37
- python: "3.7-dev"
env: TOXENV=py37
- python: "3.8-dev"
env: TOXENV=py38
allow_failures:
- python: "3.7"
env: TOXENV=py37
- python: "3.7-dev"
env: TOXENV=py37
- python: "3.8-dev"
env: TOXENV=py38

before_install:
# See issue #80: litmus fails to build on travis
# The branch 'travis-litmus' still has this enabled to investigate...
# - sudo apt-get install libneon27-dev
# - ./install_litmus.sh

install:
pip install tox-travis
- travis_retry pip install -U pip setuptools
- travis_retry pip install -U tox coveralls coverage

script:
tox
- travis_retry tox

after_success:
- coverage combine
- coveralls
70 changes: 70 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,73 @@ license_file = LICENSE
ignore =
docs/sphinx-build
docs/sphinx-build/*

[isort]
force_alphabetical_sort=True
force_single_line=False
force_to_top=True
from_first=True
lines_after_imports=2
not_skip=__init__.py
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
line_length=88

[aliases]
test = pytest

[tool:pytest]
addopts =
testpaths =
.
tests

[coverage:run]
branch = True
omit =
tests/*
wsgidav/prop_man/couch_property_manager.py
wsgidav/prop_man/mongo_property_manager.py
wsgidav/samples/*
wsgidav/server/run_reloading_server.py
wsgidav/server/server_sample.py

[coverage:report]
precision = 2
show_missing = True
sort = Name

[coverage:html]
directory = _build/coverage

[flake8]
max-line-length = 99
#max-line-length = 88

# max-complexity = 12

# Ignore some errors that may be created by Black:
# E203 whitespace before ':'
# E501 line too long
# W503 line break before binary operator
ignore =
E203,
E501,
W503

# Instead of strict E501, enable B950 for relaxed line length checking (and other bugbear warnings)
select =
B,
C,
E,
F,
Q,
W,
B9

# Options for the flake8-quotes extension:
inline-quotes = "
multiline-quotes = """
docstring-quotes = """
11 changes: 5 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


from __future__ import print_function
from setuptools import Command, find_packages, setup
from setuptools.command.test import test as TestCommand
from wsgidav._version import __version__

# from datetime import datetime
import os
import sys

from setuptools import setup, find_packages
from setuptools import Command
from setuptools.command.test import test as TestCommand

from wsgidav._version import __version__


version = __version__

Expand Down
6 changes: 3 additions & 3 deletions tests/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
file10-10-1.txt -> 1k
"""
from __future__ import print_function
from tests.util import Timing, WsgiDavTestServer
from wsgidav import __version__
from wsgidav.xml_tools import use_lxml

import datetime
import logging
Expand All @@ -57,9 +60,6 @@
import subprocess
import sys

from tests.util import Timing, WsgiDavTestServer
from wsgidav import __version__
from wsgidav.xml_tools import use_lxml

try:
# WsgiDAV 2.x
Expand Down
4 changes: 3 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# -*- coding: utf-8 -*-

import os
import pkg_resources
import sys

import pkg_resources

sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
pkg_resources.require("wsgidav")
2 changes: 1 addition & 1 deletion tests/davclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
# - Use requests instead of http.client / httplib

import copy
import requests
import sys

import requests

PY2 = sys.version_info < (3, 0)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

This test suite uses requests to generate HTTP requests.
"""
import unittest
from tests.util import WsgiDavTestServer

import requests
import unittest

from tests.util import WsgiDavTestServer

_test_server = None

Expand Down
2 changes: 1 addition & 1 deletion tests/test_litmus.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
Run litmus against WsgiDAV server.
"""
from __future__ import print_function
from tests.util import WsgiDavTestServer

import subprocess
import unittest

from tests.util import WsgiDavTestServer

# ========================================================================
# WsgiDAVServerTest
Expand Down
9 changes: 5 additions & 4 deletions tests/test_lock_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""Unit test for lock_manager.py"""
import os
import sys
import unittest
from tempfile import gettempdir
from time import sleep

from wsgidav import lock_manager, lock_storage
from wsgidav.dav_error import DAVError

import os
import sys
import unittest


# ========================================================================
# BasicTest
# ========================================================================
Expand Down
5 changes: 3 additions & 2 deletions tests/test_property_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""Unit test for property_manager.py"""
from tempfile import gettempdir
from wsgidav.prop_man import property_manager

import os
import sys
import unittest
from tempfile import gettempdir

from wsgidav.prop_man import property_manager

# ========================================================================
# BasicTest
Expand Down
Loading