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
The great toxification (part 4) #4120
The great toxification (part 4) #4120
Conversation
aa0217b
to
c845424
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically LGTM, but it seems all tests are failed. could you check it please?
setup.py
Outdated
@@ -63,25 +63,27 @@ | |||
':python_version<"3.5"': [ | |||
'typing' | |||
], | |||
':python_version<"3.4"': [ | |||
'enum34' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm? Why did you add this to dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in the Sphinx source, though currently surrounded by a try-except ImportError
. I figured we should just make it a requirement so we can remove that try-except
. Did I misinterpret something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's not dependency. It is used to inspect user's program on autodoc module when the program uses enum. So it is not requirements of Sphinx itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll add it to tests
instead so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait - we distribute autodoc
as part of Sphinx. Therefore shouldn't we provide all the dependencies for that module with Sphinx?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
autodoc
uses enum
only if it is installed. It means autodoc
imports it only if the target program uses it. So enum34
is a requirement of target program.
In other words, it is not "requirements", but also "optional".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll move this to test
so
'websupport': [ | ||
'sqlalchemy>=0.9', | ||
'whoosh>=2.0', | ||
], | ||
'test': [ | ||
'pytest', | ||
'mock', # it would be better for 'test:python_version in 2.7' | ||
'simplejson', # better: 'test:platform_python_implementation=="PyPy"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1; now pypy provides optimized json package :-)
5a68613
to
4eb1407
Compare
This is done now |
.travis.yml
Outdated
- pip install -r test-reqs.txt | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then python3.6 -m pip install mypy typed-ast; fi | ||
- pip install .[test,websupport] | ||
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then python3.6 -m pip install mypy typed-ast flake8; fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to execute flake8 only with python3.6? Once I saw a blog article saying flake8 should be executed with all interpreters. Please let me know if you know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point, but I don't think it's something to worry about too much for now. Part 5 will introduce tox-travis
so we'll have a chance to completely rework what jobs we run and maybe use flake8
on Py2.7 too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've modified this now so it'll build against all versions of Python
@shimizukawa I need your help for this. Could you review this please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
requires.append('colorama>=0.3.5') | ||
|
||
if sys.version_info < (3, 5): | ||
requires.append('typing') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this removing lines means 'drop support pip-1.5.6'.
Maybe such environment is very rare nowadays, however it would be better if it is indicated on CHANGES.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shimizukawa I've refrained from touching CHANGES because it causes merge conflicts and you guys usually do it. Should I do this or can I simply call it out in the commit message as I've done and leave the CHANGES update to maintainers?
On a side note, have you seen reno
? Is this something you might be open to using in Sphinx in a future release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll update CHANGES on merging.
This version is silly old and anyone that's _still_ using this is not going to be building Sphinx from source. Simply remove it. Signed-off-by: Stephen Finucane <stephen@that.guru>
Simply installing packages will ensure that most of the dependencies in 'setup.py' are installed, meaning 'test-reqs.txt' need only contain those necessary for testing. The only notable change is that the 'simplejson' module is dropped from the requirements list. This included as a dependency for the PyPy target, but it appears that this is not necessary today (though it may have been when the target was added in 2011). This retains 'setup.py test' which, as noted in the tox docs [1], is sometimes expected for downstream distribution testing. We may wish to find a way to synchronize requirements between 'test-reqs.txt' and this section in the future, but that's work for another day. [1] https://tox.readthedocs.io/en/latest/example/basic.html#integration-with-setup-py-test-command Signed-off-by: Stephen Finucane <stephen@that.guru>
4eb1407
to
eb8efce
Compare
We were never really using this file for its specified purpose [1]. Now that we have everything cleanly organized in 'setup.py', there really isn't any reason to keep it around. Remove it. [1] https://caremad.io/posts/2013/07/setup-vs-requirement/ Signed-off-by: Stephen Finucane <stephen@that.guru>
9d8d6c9
to
67753b7
Compare
I've resolved the merge conflict. In the process, I realized that there's actually no reason whatsoever to keep |
@tk0miya @shimizukawa Is there anything more I need to do for this? |
It seems all review are passed now. So I'll merge this tonight (in JST) |
Merged! Thank you for your contribution! |
Lovely. Thanks for the reviews, @tk0miya 😄 |
Subject: Clean up requirements
Clean up requirements (
test-reqs.txt
,setup.py
) to ensure virtualenv and non-virtualenv builds are identicalFeature or Bugfix
Purpose
To paraphrase the Zen of Python (import this):
Start modernizing the test infrastructure that's using make and other hand-crafted tools by replacing them with tox-based derivatives.
This is part four.
Detail
This is a multi-step process, with the end goal of completely removing the Makefile and running everything through
tox
. The first fours steps of these can be done in parallel, but combined they block the final two.tox
a little more friendly by enabling extras like coverage, test profiling etc. by default, and closing gaps with the current Makefile targets such as PyLint and building docs in particular formatsutils
in favor of modern alternatives likeflake8
setup.cfg
andtox.ini
, to avoid polluting the top level directory.test-reqs.txt
,setup.py
) to ensure virtualenv and non-virtualenv builds are identical (this change)The remaining two steps are blocked by the above:
tox
instead of the Makefile, and updateCONTRIBUTING.rst
to refer to tox. Deprecate the MakefileRelates