-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix setup.py and export public functions #7
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to make the project locally installable for this to work. See:
Interesting, why does this need to be added? I don't seem to need this to make it work locally, so just wondering what I'm missing here/what this step is adding? |
This makes sures that the your project is installed as per specified in your setup.py, and pipenv will make sure that your piplock file is compatible with what your setup.py as asking, to ensure consistency in your environments. There are 2 types of users of your packages:
If you don't specify your local project as your dependency, your environment won't be consistent. For example in your setup.py you have install_requires = [pandas >= 2.2.2]. But locally you're using pandas==2.0.0, and specifically a version of pandas that works in 2.0.0 but no longer in 2.2.2. If you do not list your project as a dependency in your Pipfile, Pipenv will not resolve this discrepancy, i.e.:
If you list your project as dependency in your Pipfile, Pipenv will resolve this discrepancy and automatically upgrade your Pipfile.lock to 2.2.2 (as specified in your setup.py). That way you can ensure that your Pipfile.lock is consistent with your setup.py. This example is very simple as we're only talking about 1 dependency (Pandas). But in a large project, dependencies can very quickly become messy and you can easily end up in a situation where your setup.py isn't consistent with your Piplock.file. Making your project its own dependencies will resolve that. Pipenv official docs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update README to explain what the package is used for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks so much Ian!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work!
This PR makes changes to allow a user to import this package from another environment. The following changes are made:
setup.py
to first allow the packagesmart_building_rating_calculator
to be found when installing the package, and secondly addsinstall_requires
so the dependencies of this package are installed when this package is installed.With these changes we can now use the package in the smart-building-rating-api