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

Make ld-decode into a Python package #385

Merged
merged 2 commits into from
Dec 26, 2019
Merged

Conversation

atsampson
Copy link
Collaborator

This is definitely a "please review this" PR rather than a "merge this right now" PR!

This moves ld-decode's modules into an lddecode package, and adds a setup.py script - if you're not a Python user, this is the standard way of describing and installing Python libraries/programs. The scripts are renamed to match the names they'll be installed under (ld-decode rather than ld-decode.py), and the import lines are updated to use the package.

ld-decode will still work directly from the source tree as before, but to install the modules and scripts, you can now do:

python3 setup.py build
python3 setup.py install --prefix=WHEREVER

The #! in the scripts will be updated to match the Python interpreter you use to run setup.py, so if you want a non-default python3, use that here.

I've made some arbitrary choices about module names; if you have better suggestions, let me know!

  • The package is lddecode. It can't be ld-decode because it has to be a valid identifier, and the name would collide with the script; ld_decode would be legal but unusual.
  • lddecode_core -> lddecode.core
  • lddutils -> lddecode.utils
  • ld_utils -> lddecode.plot_utils (??)
  • Otherwise, foo -> lddecode.foo

@oyvindln: this will need some matching changes to the imports in your VHS fork when you merge it, but it should be the same as I've done for the ld-decode scripts here. The VHS modules could go into an lddecode.vhs package?

Fixes #70.

filtermaker is now in scripts, and deemp.h is now part of the filter
library.
The modules are now all in an "lddecode" package. The scripts that are
useful for end-users will be installed.

I've done this with distutils.core rather than setuptools because it
doesn't need any of the extra stuff setuptools provides, and
distutils.core is usefully less picky about where it installs to.

I've also trimmed some imports that aren't being used.
@happycube happycube merged commit 65a8138 into happycube:rev7 Dec 26, 2019
@atsampson atsampson deleted the pypackage branch January 6, 2020 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants