Skip to content
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

Provide Python Packaging Information #15

Open
nivardus opened this issue Dec 28, 2021 · 3 comments
Open

Provide Python Packaging Information #15

nivardus opened this issue Dec 28, 2021 · 3 comments

Comments

@nivardus
Copy link

Would it be possible to provide basic python packaging (setup.py/pyproject.toml, PEP-518) to simplify LSL-PyOptimizer installation? Were this done, the project could be installed via pip and the CLI automatically placed into the system path.

@nivardus
Copy link
Author

Some changes to LSL-PyOptimizer would be required to make package installation possible. I've put together a cursory pass at making this possible using standard setuptools conventions: master...nivardus:pep-518 Does this seem like an acceptable route? If so, I would be willing to submit them as a PR. These changes can also be cribbed from as they are nothing special.

Thanks for the consideration.

@Sei-Lisa
Copy link
Owner

Sei-Lisa commented Dec 29, 2021 via email

@nivardus
Copy link
Author

Hello, @Sei-Lisa. Thanks for the feedback and context about repository layout and content. It should be possible to meet all of the criteria you have outlined and still provide a setup.py file for those that want to install LSL-PyOptimizer as a package.

An executable main.py file can remain in the root of the directory provided it calls a main() method contained in a module which can also be targeted by setuptools. As you mention, "cli.py" may not be a precise name. The file containing this method could be called "cmd.py" or something else; I'm impartial and it is your project. Let me know if you have a preference. I've seen both cli.py and cmd.py used in popular projects.

I'll leave the processor files alone and can move strutil into its own module. Easy to do both.

The only major change needed to package LSL-PyOptimizer is that the data files builtins.txt and fndata.txt need to be moved into a module directory. This is required in order to place the files in an unambiguous python site-packages directory. These files could go into lslopt/data/, lslopt/ or similar. The builtins-unittest.txt test file can remain where it is.

I've staged changes in a new branch which can be compared at master...nivardus:package-less. If this seems acceptable I can open a PR for further review and possible incorporation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants