Fixing: flake8 E402 and windows setup.py not working#955
Fixing: flake8 E402 and windows setup.py not working#955gavishpoddar wants to merge 10 commits intoscrapinghub:masterfrom
Conversation
…position 1442: character maps to <undefined> in Windows
Codecov Report
@@ Coverage Diff @@
## master #955 +/- ##
=======================================
Coverage 98.29% 98.29%
=======================================
Files 234 234
Lines 2694 2694
=======================================
Hits 2648 2648
Misses 46 46 Continue to review full report at Codecov.
|
| # version is used. | ||
| sys.path.insert(0, project_root) | ||
|
|
||
| import dateparser | ||
|
|
There was a problem hiding this comment.
From what I read in the comments:
Insert the project root dir as the first element in the PYTHONPATH.
This lets us ensure that the source package is imported, and that its
version is used.
I think that this import is here intentionally. I'm not sure if moving it from here would have any adversarial consequence. Wouldn't be better to change it to...
import dateparser # noqa: E402just in case? @Gallaecio
There was a problem hiding this comment.
BTW, I've seen that in parsel has the import above, so maybe I'm worrying unnecessarily:
There was a problem hiding this comment.
I had not thought of that. Indeed, having it after will prevent a system-wide-installed version of dateparser being used instead.
It should not be a problem when using tox though, I believe, since tox installs the project into its virtual environment every time.
There was a problem hiding this comment.
I prefer to keep it where it was to avoid needing to modify the comments, etc.
@gavishpoddar could you move it again where it was and add the "noqa"?:
import dateparser # noqa: E402
Thanks!
noviluni
left a comment
There was a problem hiding this comment.
Could you remove the dateparser/docs/conf.py E402 line from the pytest.ini?
thanks!
|
Hi, I have made the changes |
pytest.ini
Outdated
| addopts = | ||
| --doctest-modules | ||
| --assert=plain | ||
| --assert=plain No newline at end of file |
There was a problem hiding this comment.
It shows "No newline at the end of file" so we need to add it.
There was a problem hiding this comment.
Hi @kishan3, Currently dateparser doesn't have newlines at the end .ini files please suggest should I add them with this PR
Note: The tests are not failing without newline at the end of file
This PR Fixes,
dateparser/docs/conf.pyNote: This change makes it possible to run
pip install .. But tox is not entirely fixed.Please suggest.