-
Notifications
You must be signed in to change notification settings - Fork 366
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
[MRG] Add a Mercurial contentprovider #950
[MRG] Add a Mercurial contentprovider #950
Conversation
MyBinder could support Mercurial repositories See jupyterhub/binderhub#1148
Thanks for submitting your first pull request! You are awesome! 🤗 |
dfe56d6
to
c6d2544
Compare
@gracinet you may be interested to check what I did 🙂 |
@paugier I don't know about the repo2docker context, but the Mercurial part itself is simple and should do the job. Note that Mercurial requires Python >= 3.6 (apparently only Evolve actually enfores it through its requirements). That explains the CI failure, so you probably want to add some conditionals in your requirements and imports if repo2docker wants to keep compatibility with 3.5 (let's see maybe what project maintainers think of it first). |
Is Python 3.5 really necessary since for binderhub |
Nice work! As Georges pointed out there are several comments and function names that still contain "git" which should be tidied up. The ordered list of content providers is in repo2docker/repo2docker/app.py Line 144 in 64371cb
You have to add the hg provider to that list (below the Zenodo one I think) for it to become available to users. I created #951 to increase the minimal required Python version to 3.6. Let's see if anyone remembers if there is a reason we need to stick to 3.5 |
I added Mercurial to the |
We now use Python 3.6 as the minimal require version for repo2docker. This means if you rebase your branch on the latest |
Ah good! It's going to be simpler! Another question about |
4689123
to
4c67193
Compare
We don't need |
I don't know why we've also got a |
The reason we have a |
I found this related issue: jupyterhub/zero-to-jupyterhub-k8s#1221 |
Do you understand why the tests failed in Docker Cloud? I get a 404 error when I click on Details. |
It should be. If you update the Pipfile, run:
this will update Pipfile.lock, and you can commit the difference. Since I don't think many folks use these, there's a good chance Pipfile.lock is out of date already. The Pipfile and requirements file only directly contain dev dependencies, so if it's a runtime dependency adding to install_requires, no additional changes are required. The docker build is failing because the image lacks a compiler, which mercurial needs because they don't publish wheels |
Indeed it's very strange. I'm going to ask on Mercurial mailing list. |
Regarding Pipfile, I think it doesn't need to be updated in this PR. |
9a25d9d
to
2f9d9b6
Compare
For my education: what are these mecurial extensions that you activate in the docker image? What happens if we don't enable them (and interact with a repo that uses them)? One more thing we need is instructions to install mercurial in the docs. My suggestion would be to add a section like https://repo2docker.readthedocs.io/en/latest/install.html#prerequisite-docker but name it somehow "Optional: ". In particular explaining how to install (We should also really have a section for To set environment variables you need to edit the GitHub Actions config/workflows which are defined in I like manics suggestion of keeping the |
Personally I think it's better for tests to default to testing everything, with a flag/environment variable used to explicitly disable them if required. This reduces the risk of future refactoring inadvertently disabling them (been there in other projects..... 😄). |
Ok I understand! I will change that. |
topic and evolve are 2 extensions provided by the python package hg-evolve useful for shareable history edition. Topics are light and temporary feature branches. If you clone a repository with topics without the topic extensions, you just don't get the commits in topics. evolve adds many commands for shareable history and it may be that enabling evolve is not necessary for repo2docker. What do you think @gracinet? I enabled evolve + topics because it is standard for real users but actually we don't do history edition in repo2docker!
Yes of course! I will add that.
With Mercurial, editing config files is anyway nearly mandatory. I think Mercurial developers really like config files 🙂 For example I don't think there are equivalents of However, I could add Regarding having Of course, basic users should be able to use repo2docker with Mercurial without hg-evolve and topics. For MyBinder, hg-evolve should be installed but most users don't have to know that. |
2f9d9b6
to
5bb5869
Compare
… (no need for config file)
3ed5e08
to
97b9b24
Compare
97b9b24
to
64633bb
Compare
I think it is now ready for review. Mercurial is optional but by default tested. Mercurial tests can be disable with environment variables. There is no need for any Mercurial configuration file. For the CI, Mercurial and hg-evolve are both installed with pip (in .github/workflows/test.yml) because in Ubuntu 18.04, the Mercurial installed with apt is too old for the last version of hg-evolve (Mercurial 4.5, running with Python 2.7). |
Do you think we could make |
Nice! I think we can fine-tune things like requirements and installation a bit, but this looks like a great start to me! |
Yes you are right. It is indeed simpler and nicer like that 05002a4 |
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.
Great!
Do you have an example hg repo url we can test this on?
I tried for example |
Hi, do I need to do something more on this? |
I don't think so, just need to give people time to test it. |
Thanks a lot for adding mercurial support and the patience in responding to all the comments, questions and suggestions :) |
MyBinder could support Mercurial repositories
See jupyterhub/binderhub#1148