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

Transforms haddock3 into a python package #28

Merged
merged 6 commits into from
Jul 19, 2021

Conversation

joaomcteixeira
Copy link
Member

Transforms haddock3 into a python package. No changes in code were made yet, those are for future pull requests. So far:

  • already incorporates changes from data_path not being found #24 and Update installation instructions #25 (but it is better to merge those PRs first, nonetheless)
  • moved haddock folder inside src, this is the end of relative imports. 😺
    • if you wonder why src, please read here, in short, avoids issues with relative/absolute imports, and imports on non-installed libraries. I have been working with this setup for a couple of years now, only with positive results.
  • added basic setup.py
  • moved haddock3.py to src/haddock/clis/cli.py. After installation users now have the haddock3 command installed in the system.
  • updates installation instructions
    • I did not add the requirements to the setup.py file because there was something broken with numpy and lightdock, so I decided not to address that issue in this PR.
  • added README.rst for parsing purposes. Now it is empty. In the future README.md will be converted to README.rst.

@joaomcteixeira joaomcteixeira added the enhancement Enhancing an existing feature of adding a new one label Jul 16, 2021
@joaomcteixeira joaomcteixeira self-assigned this Jul 16, 2021
Copy link
Member

@rvhonorato rvhonorato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes, but what do we gain with it? Is the plan to distribute haddock3 via the python package index?

@joaomcteixeira
Copy link
Member Author

Why not? Surely not yet, but why not in the future? Anyway, even if we don't want to distribute it in PyPI we gain a lot having haddock3 structure as an authentic package. Some points I consider positive:

  1. end the use of relative imports, which avoids bugs and allows you to import HADDOCK3 machinery anywhere you need.
  2. Avoids the use of the global variable script. Instead, the haddock3 executable gets implemented into the system, and we don't need to activate it every time we open a new session.
  3. you can have the main function of the haddock3 executable better controlled so that you can use it in other pipelines if needed (I am preparing that pull request).
  4. more control in the future when testing with pytest
  5. simplified installation instructions, especially if we remove more complicated dependencies (Change LightDock to an optional dependency #29), we can avoid the requirements.txt.
  6. adheres to good practices and aligns with what developers and more advanced users expect
  7. other positive points aspects will emerge as we continue developing.

@joaomcteixeira joaomcteixeira merged commit 02a4057 into haddocking:main Jul 19, 2021
@joaomcteixeira joaomcteixeira deleted the make_package branch July 19, 2021 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancing an existing feature of adding a new one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants