-
Notifications
You must be signed in to change notification settings - Fork 124
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
Allow overriding configuration options #115
base: master
Are you sure you want to change the base?
Conversation
For now only when calling pynsist programmatically.
Please consider releasing 0.12 if you accept this PR. |
Just a gentle reminder to take a look at this PR if you can find the time. Thanks! |
Hi, sorry it's taken me a while to get to this! So you're using a config file, but overriding some of the options using a custom Python script? What's the motivation for this? Are there things you can't set from the config file? Settings that you want to choose programmatically? Is this for building your own installer, or are you making a tool wrapping pynsist for other people to use? (I'm not trying to say there's anything wrong with what you're doing, I just want to understand how you're using Pynsist) My initial reaction was that putting together the existing APIs should provide enough flexibility, but looking at the bits you've pulled out, I see there are several lines of code there, and it doesn't all look like stuff I'd encourage people to use as public API at present. So I can see that some simplification is necessary. If we do do it like this, I'm not sold on the name -
|
One more question (sorry!) for my understanding: if you're running Pynsist from your own code, why do you want to load a config file, as opposed to writing all of the options in your script? The answer may simply be "seems neater that way", but I'm interested to hear your thoughts. |
Me too, I'm sorry for the delay in getting back to you. I've been taking a little break... And don't worry, I encourage a thorough review of this PR (or any PR)! I basically just made it work for my use case without paying much attention to the bigger picture, I have to admit. I basically want to set the version to whatever the version of my package is. For a development version, this includes the git commit hash, for example. I do this by installing my package into
That would be perfect!
I agree that it would be best to avoid this, but I've made the minimum of changes to make it possible to override the configuration options. It can indeed be tricky to make things independent of the CWD. Not an ideal solution, but you could make use of a context manager that restored the CWD at the end. This might be good enough for now.
I guess I could do that, but it's indeed neater that way since I only need to override the version. |
I want to override the application version, so I refactored the
main()
function intomain()
andrun_installer_builder()
.