-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add pyproject toml #52
base: master
Are you sure you want to change the base?
Add pyproject toml #52
Conversation
To manage project dependencies and to make it pip installable
Now that rc_buildingsimulator is a library can replace all relative imports with absolute imports and delete add to path sections of code
Undo changes to imports etc so that CI passes
* Add pyproject.toml To manage project dependencies and to make it pip installable * Rename imports in each module Now that rc_buildingsimulator is a library can replace all relative imports with absolute imports and delete add to path sections of code * Revert rc_buildingsimulator to rc_simulator Undo changes to imports etc so that CI passes
So that building_physics can be imported via rc_buildingsimulator - see notebooks/10-min-guide...
So installs a dev version of rc_buildingsimulator in CI and resolve CI bug - No module named 'rc_buildingsimulator'
poetry run flake8 resulted in ... ModuleNotFoundError: No module named 'importlib_metadata' for Python 3.6 and 3.7 ... python-poetry/poetry#1487
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.
Firstly, I love the PR, thank you so much. This is my first time using poetry, so pardon my ignorance. I have a set of questions before I can approve this.
- Many users of this tool just clone the repo, globally pip install the dependencies and code away. They are often scientists and researchers with basic coding skills. With vagrant, I was able to offer both options. I could allow people to use vagrant to have a dependency manager, but if they didn't want that, they could just globally install the dependencies (most people have pandas, numpy etc already installed anyway). My concern with poetry is that it is a requirement and only runs through poetry. This has two issues
a. The user has to installpoetry
(following the instructions on the poetry website didn't work for me as (even with sudo) poetry can't manage my.bash_profile
. I therefore had tohomebrew
it). This can be a bit overwhelming for the person who is just using a gui python installation like anaconda.
b. We become dependent on poetry
It would be great to somehow create this inbetween situation. Perhaps for now we could have two branches. The main
, and dist
? Once our user base is happy with the pypi and it's had some user testing, we can merge this dist
branch to main
- In order to push this to pypi, do I just run
poetry build
,poetry publish
? Is there anything else I need to watch out for - Is there a reason that you changed the name from
rc_simulator
torc_buildingsimulator
. The latter seems quite verbose - I had issues running
tests/testExamples.py
.FileNotFoundError: [Errno 2] No such file or directory: 'examples/annualSimulation.py'
Looking forward to your reply. And sorry for the massive delay in reviewing. I work in healthcare at the moment, and the pandemic makes things quite busy.
@@ -11,7 +11,7 @@ | |||
|
|||
:: | |||
|
|||
from buildingPhysics import Zone #Importing Zone Class | |||
from rc_buildingsimulator.building_physics import Zone #Importing Zone Class |
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.
Out of curiosity. I there a reason for changing the headings from rc_simulator
to rc_buildingsimulator
?
@@ -75,8 +75,8 @@ | |||
|
|||
""" | |||
|
|||
import supply_system | |||
import emission_system | |||
from rc_buildingsimulator import supply_system |
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.
I have a potential issue here. A lot of people that use this tool have basic python skills (they are often scientists and researchers, not developers). Package managing with poetry is nice, but this means that people will need to install poetry in order to run the script. Currently, I have used vagrant as a local dependency manager, and lazy python programmers can just skip the vagrant step by globally installing the necessary packages and getting on with it. I can't quite seem to do this with poetry and am hesitant as there is a risk that it will form a limitation to uptake. Do you have any ideas of how we can get around this?
As I understand, once we get this on pypi, people will just pip
install it anyway
Hi @pjayathissa, thanks for the feedback and no worries on the delay!
|
To prevent a plot window from appearing during unit testing
I just remembered that prior to |
Thanks for the quick reply. You don't need to worry about running testExamples through CI. I just have that as a personal thing on my laptop to make sure that the examples are not failing. 1-2. I am leaning towards the idea of running this as a seperate |
I've added a
pyproject.toml
(viapoetry
) to manage dependencies and make this repo pip installable.