Use pyproject.toml instead of setup.cfg, pytest.ini & requirements.txt and other Python related config files#276
Conversation
|
I am interested in your opinions @leonardocarreras and @m-mirz. |
|
Good idea 👍 |
|
I think it is a great idea 🙌🏻 |
16d172f to
0b2b038
Compare
|
This is ready for review :) I've also added pre-commit as a tool to perform several checks against changes which are staged for commit. Such as removing trailing whitespaces, checking JSON, YAML and XML syntax and Python / C++ code formatting. While doing so, I realized that much of the Python code was ugly formatted. |
|
@m-mirz I guess the SonarCloud warnings are false-positives. Its at least not code which I've touched. |
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
python: pick 266daa8f wip: villas: Minor fixes and tweaks for VillasInterface Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
Remove trailing whitespaces Harmonize file endings to single empty line Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
|
Hi @martinmoraga @leonardocarreras @dinkelbachjan, Markus has reviewed and approved this change. However, we would like to find more approvals before going ahead and merging it. Do you have a second to look at this change? |
| pip3 install -r requirements.txt | ||
| pip3 install --upgrade setuptools | ||
| pip3 install --upgrade wheel | ||
| pip3 install .[test,docs] |
There was a problem hiding this comment.
Here looks like we are doing a different thing, not only installing dependencies but also the package in the currently active folder (dpsim). Is this the intended behaviour?
There was a problem hiding this comment.
Actually, this looks fine to me @stv0g @leonardocarreras
| pip3 install -r requirements.txt | ||
| pip3 install --upgrade setuptools | ||
| pip3 install --upgrade wheel | ||
| pip3 install . |
There was a problem hiding this comment.
Any particular reason for the difference here about only pip3 install . vs .[test,docs] in the packaging/Shell/install-fedora-deps-dev.sh
There was a problem hiding this comment.
@stv0g Doesn't this install the dpsim package as well and not just deps?
| @@ -24,8 +24,7 @@ apt-get -y install \ | |||
| libgraphviz-dev \ | |||
| libsundials-dev | |||
|
|
|||
| pip3 install --user -r requirements.txt | |||
| pip3 install --user -r requirements-jupyter.txt | |||
| pip3 install --user . | |||
There was a problem hiding this comment.
Any particular reason for the difference here about only pip3 install . vs .[test,docs] in the packaging/Shell/install-fedora-deps-dev.sh
There was a problem hiding this comment.
@stv0g Here I would also expect only the installation of deps and not the dpsim package.
leonardocarreras
left a comment
There was a problem hiding this comment.
Hi @stv0g! Thanks for the extra formatting, I think the code will look a lot more standardized now... From the side of the code it looks good to me in general, I would like some more opinions still on the how we do...
|
Side topic: Apparently, the more changes are here, the more Sonar complains and demands higher quality from reformatted existing code... |
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
It refers to a file named requirements-jupyter.txt which does not exist for quite some time now.. Also the file was broken by a missing line continuation.. Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
35fa11c
|
|
@stv0g @leonardocarreras I think this can be merged after the question regarding pip install have been resolved. |
|
I converted this PR to a draft, since I am splitting it up into smaller changesets and new PRs. Once, everthing is merged, I will close this one. |




Modern Python is slowly adopting
pyproject.tomlas a single place to define a Python package and related tool settings like black for formatting, flake8 for linting and pytest for testing.Lets try to move as much of the Python-related project configuration to this file and unclutter the root of the repo.
This PR does:
requirements*.txt,pytest.iniandsetup.cfgfiles intopyproject.tomlpyproject.toml.gitlab-ci.yml