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
Support installed packages #5
Conversation
7b9fff3
to
9c8b08c
Compare
@asottile I think this is now ready for merge and shipping 👍 |
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
d7e43be
to
6f1c291
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.
didn't get to review the whole thing, but here's a first pass
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
Without being able to automatically set paths, for which upstream does not have an API 🤦♂ I'm no longer interested in pursuing this further. I was hoping to shrink my conf from 25 lines to 3, but this would mean I'd need to settle at 10, plus an external dependency. |
I live this open for now. Feel free to review it 🤷♂ further; I'll keep in the source thing though. |
b006e7e
to
760f5e1
Compare
@asottile upstream released a fix for |
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
760f5e1
to
c22492b
Compare
I couldn't get this working with a simple example, so I tried to fix it -- here's my patch on top of your branch: https://github.com/asottile/covdefaults/pull/new/installed-source-asottile I was validating this by using diff --git a/setup.cfg b/setup.cfg
index fa1ab4b..bb47bd5 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -20,6 +20,8 @@ classifiers =
Programming Language :: Python :: Implementation :: PyPy
[options]
+package_dir =
+ =src
py_modules = astpretty
python_requires = >=3.6.1
@@ -35,6 +37,7 @@ universal = True
[coverage:run]
plugins = covdefaults
+parallel = true
[mypy]
check_untyped_defs = true and
and then using the coverage commands: $ coverage erase && coverage run -m pytest tests && coverage combine && coverage report
============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /home/asottile/workspace/astpretty
collected 27 items
tests/astpretty_test.py ..........................x [100%]
======================== 26 passed, 1 xfailed in 0.11s =========================
Name Stmts Miss Branch BrPart Cover Missing
---------------------------------------------------
---------------------------------------------------
TOTAL 99 0 0 0 100%
2 files skipped due to complete coverage. |
@asottile your proposal seems to me that you just put things back to track the source tree and not the installed package. |
Investigating this I don't think it's easy to do this reliably for the general case, so I'll retract my feature request. Realized this would only make sense with source layout and that might be too much specialization. |
Resolves #3.
__main__
; this should be covered via theif __main__
part; and I don't think it's bad practice to put code into the__main__.py
..venv
as python environment folders as per https://discuss.python.org/t/trying-to-come-up-with-a-default-directory-name-for-virtual-environments/3750 seems also a popular choice.nox
to also handle people using nox instead of tox