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

Fade to black #314

Merged
merged 20 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from 7 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
9 changes: 1 addition & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
*.pyc
*~
.DS_Store
/.coverage
/.coverage.*
/.eggs
/.hypothesis/
/.mypy_cache
/.tox/
/_trial_temp/
Comment on lines -4 to -10
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These scribble into ./.tox/

/build/
/dist/
/docs/_build/
/htmlcov/
/src/*.egg-info
htmlcov
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ matrix:
include:
- python: 3.8
env: TOXENV=flake8
- python: 3.8
env: TOXENV=black
- python: 3.8
env: TOXENV=mypy

Expand Down Expand Up @@ -102,8 +104,8 @@ matrix:


install:
- ./.travis/install
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script doesn't do anything useful any more; tossing it.

- pip install tox


script:
- ./.travis/run tox
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script doesn't do anything useful any more; tossing it.

- tox
54 changes: 0 additions & 54 deletions .travis/environment

This file was deleted.

6 changes: 0 additions & 6 deletions .travis/install

This file was deleted.

8 changes: 0 additions & 8 deletions .travis/run

This file was deleted.

13 changes: 11 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
include LICENSE
include README.rst
include .coveragerc
include .travis/twistedchecker-diff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to include this in distributions? It's not useful out of VCS, is it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .coveragerc should be included, so you can run Tox from a source distribution and get the same results we get in development.

twistedchecker-diff should go away entirely… I'll submit a PR for that.

include AUTHORS
include CONTRIBUTING.rst
include docs/Makefile
include LICENSE
include NEWS.rst
include pyproject.toml
include README.rst
include tox.ini
recursive-include docs *.py
recursive-include docs *.rst
recursive-include docs *.txt
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build-system]

requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"


[tool.black]

line-length = 80
target-version = ["py27"]
6 changes: 4 additions & 2 deletions src/klein/_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ def procureSession(self, request, forceInsecure=False):
# manipulation could succeed (no CSRF token check could
# ever succeed, for example).
raise NoSuchSession(
u"Can't initialize a session on a {method} request."
.format(method=request.method.decode("ascii"))
u"Can't initialize a session on a "
u"{method} request.".format(
method=request.method.decode("ascii")
)
Comment on lines +176 to +179
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that when black reformats it, we stay within max line length.

)
if not self._setCookieOnGET:
# We don't have a session ID at all, and we're not allowed
Expand Down
5 changes: 3 additions & 2 deletions src/klein/test/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ def test_interfaceCompliance(self):
store = MemorySessionStore()
verifyObject(ISessionStore, store) # type: ignore[misc]
verifyObject(
ISession, self.successResultOf( # type: ignore[misc]
ISession, # type: ignore[misc]
self.successResultOf(
store.newSession(True, SessionMechanism.Header)
)
),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that when black reformats it, we the # type: ignore comment for ISession stays with it.

)


Expand Down
7 changes: 5 additions & 2 deletions src/klein/test/test_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -936,8 +936,11 @@ def _eb(result):

self.assertEqual(
str(failure.value),
("Request.finish called on a request after its connection was "
"lost; use Request.notifyFinish to keep track of this."))
(
"Request.finish called on a request after its connection "
"was lost; use Request.notifyFinish to keep track of this."
)
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that when black reformats it, we stay within max line length.


d.addErrback(lambda _: finished)
d.addErrback(_eb)
Expand Down
Loading