Should git ignore .pyproject file?
-
This
.pyproject
file puts all files added in one line:{ "files": ["library/server.py", "library/client.py", "logger.py", ...] }
AND the order of the items changes everytime you add a new item. Did the person who make implemented consider that this is an absolute disaster for version control (git)? Any merges of branches with different components will involve looking component by component manually to check what is being added and what is missing. This design is so bad, unless I'm missing something.
The only way to reasonably work with this is ignorning the file. But documentation says it's used for Qt Creator to load files... So?
-
This
.pyproject
file puts all files added in one line:{ "files": ["library/server.py", "library/client.py", "logger.py", ...] }
AND the order of the items changes everytime you add a new item. Did the person who make implemented consider that this is an absolute disaster for version control (git)? Any merges of branches with different components will involve looking component by component manually to check what is being added and what is missing. This design is so bad, unless I'm missing something.
The only way to reasonably work with this is ignorning the file. But documentation says it's used for Qt Creator to load files... So?
@Developer123 said in Should git ignore .pyproject file?:
The only way to reasonably work with this is ignorning the file. But documentation says it's used for Qt Creator to load files... So?
Which tells you that it should not go into git since it's QtCreator dependent like e.g. CMakeLists.txt.user
-
@Developer123 said in Should git ignore .pyproject file?:
The only way to reasonably work with this is ignorning the file. But documentation says it's used for Qt Creator to load files... So?
Which tells you that it should not go into git since it's QtCreator dependent like e.g. CMakeLists.txt.user
@Christian-Ehrlicher So it should be ignored by git?
-
@Christian-Ehrlicher So it should be ignored by git?
@Developer123 Yes, it should not be committed to the repository
-
@Developer123 Yes, it should not be committed to the repository
@jsulm So I put
*.pyproject
file in.gitignore
. Now I cloned the repository, and<projet>.pyproject
is not there. I tried opening the project within Qt Creator and... there is no file to select to open the project, only QML files, etc.If I simply open the folder within QtCreator, then the
Design
tab doesn't work because it gives errors (QML emulator layer error, which was fixed on the original project that had the.pyproject.user
file). ButProjects
button on the left bar is grayed out and I can't set the settings again, alsoRun
is grayed out, because... I have no project anymore?Are you sure we are supposed to ignore the
.pyproject
file? -
@jsulm So I put
*.pyproject
file in.gitignore
. Now I cloned the repository, and<projet>.pyproject
is not there. I tried opening the project within Qt Creator and... there is no file to select to open the project, only QML files, etc.If I simply open the folder within QtCreator, then the
Design
tab doesn't work because it gives errors (QML emulator layer error, which was fixed on the original project that had the.pyproject.user
file). ButProjects
button on the left bar is grayed out and I can't set the settings again, alsoRun
is grayed out, because... I have no project anymore?Are you sure we are supposed to ignore the
.pyproject
file?@Developer123 Looks like we gave you wrong advice. .pyproject file is used by QtCreator to manage Python projects (I don't use QtCreator to handle Python projects, so didn't know).
-
@Developer123 Looks like we gave you wrong advice. .pyproject file is used by QtCreator to manage Python projects (I don't use QtCreator to handle Python projects, so didn't know).
@jsulm Ok so.. what's the solution for developing QtQuick (PySide2) with github?
-
@jsulm Ok so.. what's the solution for developing QtQuick (PySide2) with github?
@Developer123
[So far as I know.] Assuming this includes your.pyproject
file (unless I have misunderstood), the "solution" is to include that in your git. You do not "like" that it causes differences due to re-ordering, but that does not make it "wrong". -
@Developer123
[So far as I know.] Assuming this includes your.pyproject
file (unless I have misunderstood), the "solution" is to include that in your git. You do not "like" that it causes differences due to re-ordering, but that does not make it "wrong".@JonB said in Should git ignore .pyproject file?:
You do not "like" that it causes differences due to re-ordering, but that does not make it "wrong".
I think it would be worth creating a QtCreator bugreport for this current behavior. While adding a new file to the project will create a single line diff however they are ordered (or re-ordered), many diff tools are good at highlighting differences within a single line change. So they would benefit from not having the files re-ordered.
-
@Developer123
[So far as I know.] Assuming this includes your.pyproject
file (unless I have misunderstood), the "solution" is to include that in your git. You do not "like" that it causes differences due to re-ordering, but that does not make it "wrong".@JonB it's not that I don't like, it's just almost impossible to develop any medium-large software like this. Any branch merges that add/remove components will collide and require manual inspection of every component of the entire project listed on the
.pyproject
file. -
@JonB it's not that I don't like, it's just almost impossible to develop any medium-large software like this. Any branch merges that add/remove components will collide and require manual inspection of every component of the entire project listed on the
.pyproject
file.@Developer123
Well somehow others have managed. You have a choice: work with what you have now, or give up developing until you have reported the issue, it has been accepted, fixed and released, and you upgrade to that new version. That is your decision.If this is the only show-stopper, maybe you should write a small Python script to parse this file and re-order these lists to always be in, say, alphabetical order. You could use that when comparing, or if you say Qt only rewrites the lines when a new item is added you might run the script on the
.pyproject
file whenever you/someone does add a new item and then only check in that file when it has been "normalized". Yes it's a pain, but that seems to be where you are at right now. -
@Developer123
Well somehow others have managed. You have a choice: work with what you have now, or give up developing until you have reported the issue, it has been accepted, fixed and released, and you upgrade to that new version. That is your decision.If this is the only show-stopper, maybe you should write a small Python script to parse this file and re-order these lists to always be in, say, alphabetical order. You could use that when comparing, or if you say Qt only rewrites the lines when a new item is added you might run the script on the
.pyproject
file whenever you/someone does add a new item and then only check in that file when it has been "normalized". Yes it's a pain, but that seems to be where you are at right now.@JonB "You're right, it's an issue with the tool experienced by developers, we need to report and fix that".
It's not hard you know
-
@Developer123 said in Should git ignore .pyproject file?:
It's not hard you know
This is a user forum, QtCreator developers most likely have not seen this post. You can create a bugreport so that they are made aware of this issue.
-
@Developer123 said in Should git ignore .pyproject file?:
It's not hard you know
This is a user forum, QtCreator developers most likely have not seen this post. You can create a bugreport so that they are made aware of this issue.
@mchinand Thanks that was a good advice.
I looked it up, this issue was already created, but the priority is "somewhat important".. so probably will remain a bug unless more people complain