Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Forbid import when tensorflow is not installed #186

Merged
merged 2 commits into from
Jul 3, 2023

Conversation

willGraham01
Copy link
Collaborator

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
See brainglobe/BrainGlobe#27 - this PR is for conda-forge compatibility reasons.

What does this PR do?
This PR forbids the import of cellfinder_core when tensorflow is not installed.

Note that we do not need to remove tensorflow from the pyproject.toml dependencies - these are read only by pip and not by conda.

References

Resolves step 1 of this issue.

How has this PR been tested?

Local testing of pip package install:

$ conda activate cellfinder
(cellfinder) $ pip install .
(cellfinder) $ python 
>> import cellfinder_core
# All good
>> exit()
(cellfinder) $ pip uninstall tensorflow
(cellfinder) $ python
>> import cellfinder_core
# Throws expected error
(cellfinder) $ pip install tensorflow
(cellfinder) $ python
>> import cellfinder_core
# All good again
>> exit()

Is this a breaking change?

No. New version, PyPI upload, and conda-forge recipe required though.

Does this PR require an update to the documentation?

Updates README to explain that the conda-install will not fetch tensorflow, this will have to be done by the user.

Requires a change on brainglobe-meta repository.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@willGraham01 willGraham01 marked this pull request as ready for review July 3, 2023 12:35
@willGraham01 willGraham01 requested a review from adamltyson July 3, 2023 12:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants