Parse and use explicit platform specifications.#1033
Parse and use explicit platform specifications.#1033wolfv merged 12 commits intomamba-org:masterfrom
Conversation
|
The clang-format linting failed, but it's all on files that I never touched? I automatically clang-format any files I change. |
|
The other failing tests seem to be using an installed version of mamba rather than one built from source? That's why the python tests are failing (they work if I run pytest myself). |
| create_args.append("--allow-softlinks", no_dry_run=True) | ||
| create_args.append("--allow-softlinks") | ||
| if always_copy: | ||
| create_args.append("--always-copy", no_dry_run=True) |
There was a problem hiding this comment.
I think we should keep the no_dry_run=True here because we check if we're linking the packages correctly by looking at inode etc.
There was a problem hiding this comment.
Uh, that fails when I run the test, saying you can't have keyword args in list.append? no_dry_run=True is there just below in the call to create.
|
@wolfv Any comment on the failing tests? Do I need to rebase on master again? |
|
@afranchuk I am currently pushing a lot to get this released: openSUSE/libsolv#457 Will have to take a deep dive into this PR after. I think some issues should be easily fixable, though (e.g. AttributeError: 'Channel' object has no attribute 'platform_urls' ... I think there are legitimate failures. |
bd1430a to
14914ac
Compare
|
I was able to reproduce the pytest errors (I didn't realize I had accidentally excluded them before), and I think I fixed all of them (by changing how some parts of the python code work). |
|
I can run clang-format on everything, but it's still a bit odd that the linting for that is failing on files I never changed. Though maybe the explanation is simple: I'm using a newer version of clang-format than the CI, which differs a bit with the older versions. This explains the CI saying files change and my local clang-formatting changing many files as well. I'm not sure what the correct approach for such differences is (is there some way to make it more strictly interpret the |
|
Looks like there's still one test failing, let me see if I can track down why. |
|
The CI mentions: |
|
Bah, simple typo. |
|
Weird though, I ran the tests myself and it didn't have that error. |
|
alright, looks like one remaining issue with windows for mamba: stdout = b'{\r\n "command": "C:\\Miniconda\\Scripts\\mamba create -p C:\\Users\\runneradmin\\AppData\\Local\\T...ict[split_anaconda_token(remove_auth(c))[0]]\nKeyError: 'file://d/a/mamba/mamba/test/channel_b/win-64'\n"\r\n}\r\n' Maybe it's the trailing slash? or the |
|
Yeah, unfortunately at the moment I don't have a windows machine to fix the windows errors more rapidly, but I'll try a few things. |
|
I can debug it on windows on the next days if this doesn't work out :) |
|
I added some context to the exception, it looks like it's being queried with |
|
It's not immediately obvious what is altering the file path to |
|
I think the issue is the |
|
Basically their implementation is wrong for windows |
Rather than trying to figure out whether a channel string/url contains a platform, we instead make platform specification explicit with `CHANNEL[PLATFORM1,PLATFORM2,...]`. There is a refactor of the channel class here to hide implementation details/functions which are only relevant for testing.
The python tests will probably still need some more changes.
Some of these fixes have nothing to do with the changes in this branch.
c++) to fix pytest errors.
This removes the call to conda's prioritize_channels, it's not clear whether this is actually necessary.
897c2e3 to
feec101
Compare
|
Okay, looks like all that's wrong is the linting (though I can't fix that myself apparently since my |
|
Great work! Fixing the linting is easy for me (just run pre-commit run —all) I’ll need to have a deep dive into this refactor. I saw that you’re using std::optional which is one thing I’m not sure about (since we need to support pretty old macOS versions) but we could quite easily refactor that to pointers or similar |
|
I just ran the linter, let's see if it passes now :) |
|
Awesome! Yeah I have clang-format 12, beware of differences in the future! |
| // | ||
| // The full license is in the file LICENSE, distributed with this software. | ||
|
|
||
| #include <set> |
There was a problem hiding this comment.
No longer needed.
- Remove
|
I am testing this PR right now, gonna write down observations as I go: When using micromamba, and I have IMO the command line here should overwrite the other configured conda-forge config, shouldn't it? |
This means this fails now like this: I think it would be better in this case to fail with a donwload error of some sort (which we did otherwise with the existence of the noarch channel). If we explicitly request some platforms, we coudl require that all of them resolve to something on the server..? |
|
Let's fix the remaining issues on master :) |
|
Sounds good! As to your comments:
I'm not so sure. You could certainly make a decision here about how you think it should behave, but I think the behavior you saw is okay/expected, same as if you had specified
This seems like an error priority issue. I'd argue that any 404 received for a configured channel should take precedence as a final user-visible error over an error that a package could not be resolved. Are there any use cases where you'd want a 404 to be ignored? |
|
@afranchuk yes, if you request a channel that doesn't implement the default platform the error should be ignored. e.g. you can use |
|
@afranchuk it seems that the load_channels implementation also changed slightly, correct? Would you mind detailing what I'll have to adjust in Currently it doesn't seem to load the Maybe we could actually revert this behavior in a way that keeps boa working? |
|
@wolfv
There should probably not be a tuple, opting for a |
|
I think one problem is that when giving a platform explicitly now noarch isn't implicitly loaded. That's breaking boa right now but I'll come up with a fix tomorrow :) |
|
Oh yeah you're right, |
Rather than trying to figure out whether a channel string/url contains a platform, we instead make platform specification explicit with
CHANNEL[PLATFORM1,PLATFORM2,...].There is a refactor of the channel class here to hide implementation details/functions which are only relevant for testing.
This is a rework related to discussion at #934, and will close #794.
Note that this introduces breaking CLI changes as well as breaking Python API changes (the
Channelclass is improved), so these should be noted in the changelog.