-
Notifications
You must be signed in to change notification settings - Fork 466
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
Fixing: flake8 E402 and windows setup.py not working #955
base: master
Are you sure you want to change the base?
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.
|
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.
The fixes seem safe to me.
docs/conf.py
Outdated
# version is used. | ||
sys.path.insert(0, project_root) | ||
|
||
import dateparser | ||
|
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.
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: E402
just in case? @Gallaecio
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.
BTW, I've seen that in parsel
has the import above, so maybe I'm worrying unnecessarily:
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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!
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.
Done 👍🏻
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.
Could you remove the dateparser/docs/conf.py E402
line from the pytest.ini
?
thanks!
Hi, I have made the changes |
pytest.ini
Outdated
@@ -1,4 +1,4 @@ | |||
[pytest] | |||
addopts = | |||
--doctest-modules | |||
--assert=plain | |||
--assert=plain |
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 shows "No newline at the end of file" so we need to add it.
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.
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.py
Note: This change makes it possible to run
pip install .
. But tox is not entirely fixed.Please suggest.