-
Notifications
You must be signed in to change notification settings - Fork 140
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
Add option to ignore VCSError #133
Comments
I've deliberately started off with this strict with this to see how it works out before relaxing it. To help me understand the need:
The idea is that you need to make a positive decision on which files belong in the sdist. Since I'm trying to avoid something like MANIFEST.in, the VCS is how we decide that. The error message isn't quite accurate: you don't actually need to commit new files, it's enough to Depending on what you want this for, you can run I want to avoid adding a 'eh, whatever' flag which just bypasses the check, because developers are lazy, and before long people will just use that flag all the time. |
maybe add a test mode? I want to test my builds before commiting and releasing, so I see your motivation and I agree, but you can keep the constraints on |
Do you mean you want to test that building works? Or you want to build it so that you can run tests? And if so, how are you doing that? |
There are some cases
I know it is not a common case, not everyone tests the builds like this. |
Why not commit everything, and test without pushing ? If all works great, than all is good, otherwise just --amend your commit ? |
Reiterating, but you don't actually need to make a commit - just I'm going to spin a background thread on how we could make this easier - in particular, if there's something better to do than making an option to skip the check. For the check-the-build-works part, one possibility is to add a command like |
I think there's just a bit confusion here, because the exception message doesn't make it clear that you just need to stage all files. Maybe replacing
If mercurial has different terminology we can have different messages based on the vcs. Then we could add the helpful but specific |
I didn't understand the method flit used to find out what files would be part of the package... apparently somebody needs to create a module for Fossil. Until then, I'm out of luck, apparently. |
If you want to have a go at writing that, it shouldn't be much work - depending on how tricky it is to do the required operations with fossil. It needs:
|
You were right, it wasn't much work.
I'm attaching them in this ZIP file: fsl.zip |
Thanks, I've turned your files into pull request #224. |
A brief comment from someone learning python - I'm putting my first package together and I've just hit the brick wall that flit appears to require that package code is in VCS (at least 'flit build' crashes if you try to run it on a package not in VCS). This requirement isn't in the documentation. This requirement is hard on newcomers - I'm struggling to learn the mechanics of packaging based on assembling and distributing a small package I'm developing locally. I'm happy enough with my local source code control in the short term. So I'm deferring getting to grips with git until I have a proper handle on packaging (avoiding "trying-to-learn-too-many-things-at-once" syndrome). It would be nice if flit could provide a sand box/testing mode that novices like myself could use for local packages. Particularly so given that all of the pypa examples and tutorials are based on local packages rather than using a VCS. Could I suggest either updating the document to specify that flit only works on packages in VCS, or request that flits implements support for local, non-VCS packages? Finally, my apologies - not quite as brief a comment as I planned! |
I think if Git proves to be too complex for you and you are happy with
local SCC, you may want to try Fossil <fossil-scm.org>. There is a branch
(still unmerged, I think) where there are some additions I created to use
flit with Fossil.
|
Thanks for the steer Richie - if I was sticking with local SCC, I'd definitely look into Fossil. The problem isn't complexity. It's just that I had a lot of balls in the air trying to understand how python packaging works - especially given that from an outsiders perspective, I'm trying to do this in the middle of a packaging war! Adding learning how VCS or local SCC works and integrates with my IDE did not add to the fun. In the end I've bitten the bullet, read an awful lot of sometimes contradictory documentation, and got github, setuptools, twine and pypi working for me. Quite a lot red wine followed. I'll amend my previous comment though: the requirement for VCS in flit isn't newbie friendly. That said neither is the pypa recommended approach! While I'd prefer flit for simplicity, I'm going to hold off for now until there is some sort of resolution on #236. |
I just came across this issue because I'm setting up flit for the first time on my first project. I thought I wanted a bypass flag when I got here, but now I've changed my mind. Perhaps you could avoid the user confusion by using the word "Add" instead of "Commit" in the error message? If the error message hinted that a |
Maybe I'm a VERY sloppy programmer, but usually I have test files lying in my working tree, that I do not want to add to the index. They are just there for future work, testing, todos, etc. I know how to manage a correct build/test/VCS process: the extra-security that makes impossible to shoot myself in the foot is just annoying. In other words, what's the point in forcing me to add to the index a (Just my opinion, so please feel free to ignore my comment, If you think that this is an important flit feature.) |
By default, the source dist includes everything that's tracked in your VCS under the folder containing Since Flit 2, you can include & exclude files in the config file (https://flit.readthedocs.io/en/latest/pyproject_toml.html#sdist-section ). So you could have a scratch/ subfolder and put it in the |
I understand the flit approach this way:
With respect to this approach we have three different cases
Currently for flit, 1. and 2. are an error and 3. is ignored. My suggestion: make 2, and 3 warnings, and add a way for silencing them, something like Finally, regarding your suggestion about a But again, this is just my personal view, so thank you for your comments. |
Great to see the new To answer your use case question:
The first case seems to be covered by |
I believe I have a reasonably valid use case for this. While building an RPM we don't wish the .git directory to be part of the sources thus we have a clean root without VCS but I want the ability to flit build the wheel then install the wheel where needed. As it stands now without the ability to ignore the VCS requirement, it doesn't appear flit build can be used in an RPM spec file (from what I have found). -Erinn |
@erinn - this should no longer be a requirement with Flit 2. Now, if it can't find a VCS, it will build the sdist with just the same files that would go into the wheel. Edit: the same files give or take inclusions and exclusions specified in pyproject.toml : https://flit.readthedocs.io/en/latest/pyproject_toml.html#sdist-section |
While in development, I want o be able to run
flit build
before commiting and adding files to my github repo.if I do that I get
I want to be able to do:
$ flit build dev #or $ flit build --novcs
So I can test my builds before commiting
The text was updated successfully, but these errors were encountered: