Conversation
|
The CVS fetcher isn't covered by self-tests. Where/how should I add them? Should I? |
|
I think tests would be good, see Docs would also be good. They can be added here: https://spack.readthedocs.io/en/latest/packaging_guide.html#fetching-from-code-repositories |
|
The error is: while installing Python. That's unrelated to my pull request. |
|
The last remaining error is from codecov, complaining that part of the code is not covered by tests. That's not true – these lines are definitively executed when running the unit tests. (I recall having to correct errors in some of these lines.) |
|
This is ready to be reviewed, btw. Docs and tests are there as well. |
|
Ping? |
|
Ping? |
adamjstewart
left a comment
There was a problem hiding this comment.
I'm guessing we aren't getting coverage because CVS isn't installed on the OS the GitHub Actions are running on.
|
@scheibelp There has been a development after your review... It turns out that CVS uses different date formats on different systems. Parsing with
Note that this only affects testing, CVS support itself doesn't require this package. I've implemented the third with a few if sys.version_info >= (2, 7):
# This package does not exist for Python <2.7. That means that we cannot
# test checkouts "by date" for CVS respositories. (We can still use CVS
# repos with all features, only our tests break.)
from dateutil.parser import parse as parse_date
else:
def parse_date(string):
return NonePlease let me know whether this is fine. |
|
I've converted this to a draft since I didn't want this to be merged automatically. |
|
I also prefer option 3 of #23212 (comment), although my preference is that this be implemented with On the other hand, that separates the skip from the reason (i.e. the construction in the fixture in And it also occurs to me it might be worth mentioning that CVS outputs different date formats for different systems in a comment related to this logic. |
|
Closing/reopening to restart pipeline |
|
Thanks! |
|
🎆🎆🎆
…On Tue, Jun 22, 2021 at 12:51 PM Peter Scheibel ***@***.***> wrote:
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#23212 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUECUDYKDGTO6Y6V7PXTDTUC5SRANCNFSM43NRZIRA>
.
--
Erik Schnetter ***@***.***>
http://www.perimeterinstitute.ca/personal/eschnetter/
|
| import tempfile | ||
| import xml.etree.ElementTree | ||
|
|
||
| if sys.version_info >= (2, 7): |
There was a problem hiding this comment.
@eschnett according to https://github.com/spack/spack/pull/24471/checks?check_run_id=2887741511 this is also not supported for Python 2.7 either (at least on our CI systems). I'm not sure why but that didn't get caught in the CI for this PR, but I think this statement will have to skip import of dateutil for all Python 2.x. Do you have a minute to update this? I'm trying to get time ASAP but won't be able to for another hour or so.
There was a problem hiding this comment.
I still see errors like the one above (e.g. at https://github.com/spack/spack/pull/24388/checks?check_run_id=2890513500). I don't think this is related to Python 2.7, because it's not the CVS-related code that is failing.
I think what is going on is the following: As part of the test suite, there is an analysis stage (related to external/_pytest) which analyzes the Python code. This analysis stage comes across the import dateutil statement and cannot handle it.
I don't know what external/_pytest does, or what analysis stage that is. But maybe it would suffice to tell this stage that dateutil is now a fine package to be imported, and to not worry about it.
There was a problem hiding this comment.
I am surprised: at least one PR submitted since #24473 has passed CI (#24481) so I'm wondering if there is an issue where PRs that failed due to this are difficult to correct (for the PR you linked, it hit this problem, and you pushed additional commits after it was corrected, but I see the CI fails in both cases).
There was a problem hiding this comment.
I think this uncovered some kind of subtle bug where package only PRs are running on Python 3.8 when in the Python 2.7 CI job
|
I see this PR introduced a dependency on $ spack unit-testwhile after this PR we need to: $ pip install python-dateutilbefore running any unit test locally. Is this wanted? |
Before spack#23212 people could clone spack and run ``` spack unit-tests ``` while now this is not possible, since python-dateutil is a required but not vendored dependency. This change makes it not a hard requirement, i.e. it will be used if found in the current interpreter.
Before spack#23212 people could clone spack and run ``` spack unit-tests ``` while now this is not possible, since python-dateutil is a required but not vendored dependency. This change makes it not a hard requirement, i.e. it will be used if found in the current interpreter.
…ed (#24484) * Force the Python interpreter with an env variable This commit forces the Python interpreter with an environment variable, to ensure that the Python set by the "setup-python" action is the one being used. Due to the policy adopted by Spack to prefer python3 over python we may end up picking a Python 3.X interpreter where Python 2.7 was meant to be used. * Revert "Update conftest.py (#24473)" This reverts commit 477c8ce. * Make python-dateutil a soft dependency for unit tests Before #23212 people could clone spack and run ``` spack unit-tests ``` while now this is not possible, since python-dateutil is a required but not vendored dependency. This change makes it not a hard requirement, i.e. it will be used if found in the current interpreter. * Workaround mypy complaint
|
@alalazo I don't know what "to vendor" means. Yes, one now needs to install |
That's a good definition of what I mean by "vendor". We have a few 3rd party libraries shipped with Spack in
Should be hopefully solved by #24484 thanks! |
Spack packages can now fetch versions from CVS repositories. Note this fetch mechanism is unsafe unless using :extssh:. Most public CVS repositories use an insecure protocol implemented as part of CVS.
…ed (spack#24484) * Force the Python interpreter with an env variable This commit forces the Python interpreter with an environment variable, to ensure that the Python set by the "setup-python" action is the one being used. Due to the policy adopted by Spack to prefer python3 over python we may end up picking a Python 3.X interpreter where Python 2.7 was meant to be used. * Revert "Update conftest.py (spack#24473)" This reverts commit 477c8ce. * Make python-dateutil a soft dependency for unit tests Before spack#23212 people could clone spack and run ``` spack unit-tests ``` while now this is not possible, since python-dateutil is a required but not vendored dependency. This change makes it not a hard requirement, i.e. it will be used if found in the current interpreter. * Workaround mypy complaint
No description provided.