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

Pypi testing #184

Merged
merged 4 commits into from
Nov 10, 2021
Merged

Pypi testing #184

merged 4 commits into from
Nov 10, 2021

Conversation

mmdocherty
Copy link
Collaborator

@mmdocherty mmdocherty commented Nov 6, 2021

Aims to resolve #182.

Quite basic hotfix for pip not being able to access harmonic submodules.

  • added .vscode/ to .gitignore.
  • added license info to setup.py setup container
  • changed packages to simply 'harmonic' in setup.py setup container. This change was inspired by looking at similar repos' setup.py configurations.

Tests this change fixes things:

v1.0.0:

python>>> import harmonic as hm
>>> test = hm.Chains(2)
Consolde ouput: ImportError module harmonic has no attribute 'Chains'
python>>> dir(harmonic)
Consolde ouput:['__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__']

After this PR:

>>> import harmonic as hm
>>> test=hm.Chains(2)
>>> print(test)
<harmonic.chains.Chains object at 0x7ff0c6b1ce20>
>>> dir(hm)
['Chains', 'Evidence', 'Shifting', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'chains', 'evidence', 'logs', 'model', 'utils']

@mmdocherty
Copy link
Collaborator Author

mmdocherty commented Nov 7, 2021

The tests I am doing to see if it works is as follows:

From root dir in fresh conda py3.8.0 env:

(harmonic) $  pip install -r requirements/requirements-core.txt && pip install . (1)

Then moving to another random dir in my home folder and running a python interpretor:

(harmonic) >>> import harmonic as hm
(harmonic) >>> test = hm.Chains(2)
(harmonic) >>> print(test)

This seems to work now!

This branch also works the other src way with new fresh conda env this running getting_started.sh then pytest etc

@mmdocherty mmdocherty marked this pull request as ready for review November 8, 2021 16:30
Copy link
Collaborator

@CosmoMatt CosmoMatt left a comment

Choose a reason for hiding this comment

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

Looks good! :)

@mmdocherty mmdocherty merged commit 2b15393 into main Nov 10, 2021
@mmdocherty mmdocherty deleted the pypi_testing branch November 10, 2021 08:48
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

Successfully merging this pull request may close these issues.

Sort harmonic import to capture submodules cleaner
2 participants