You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, things are set up such that every file in src/panda3d-stubs, except for interrogatedb.pyi and dtoolconfig.pyi, is written by running idbstubs, then formatted with Black. Changes to idbstubs affecting the output are accompanied by the changes resulting from rewriting those stubs.
I'm uncertain whether this is the best way to do things, though.
One alternative is to treat idbstubs more like Mypy's stubgen, which writes templates for stubs that can be expanded on. This would have the benefits of simplifying idbstubs (special_cases.py could be almost entirely eliminated) and not requiring it and Black to be re-run every time panda3d-stubs needs to be modified.
Another alternative would be to move in the opposite direction. idbstubs could be made to do more of the formatting Black does by itself, negating the need to run Black as often in a different way. This would have the benefit of simplifying the relationship between idbstubs and panda3d-stubs, as well as possibly removing the need to store the latter in the repository. (If this approach were taken, idbstubs would probably also be modified to write the stubs for interrogatedb and dtoolconfig.)
The current setup is not without merit, though. It compromises between simple code in idbstubs and a simple workflow for changing panda3d-stubs. It also means that updating those stubs for a new version of Panda3D is mostly automatic, a benefit shared with the second alternative.
There may be more routes that could be taken, and I am open to suggestions and examples of other projects that have dealt with similar decisions.
The text was updated successfully, but these errors were encountered:
Since psf/black#3564 is available as part of the preview style in the latest release of Black, idbstubs formats the stubs the same way Black would as of 24e1a56. This means I have effectively settled on the second option presented in the initial issue. I have no plans to remove the stubs from the repository, though, as it's helpful to see how they're affected by external changes.
Currently, things are set up such that every file in
src/panda3d-stubs
, except forinterrogatedb.pyi
anddtoolconfig.pyi
, is written by runningidbstubs
, then formatted with Black. Changes toidbstubs
affecting the output are accompanied by the changes resulting from rewriting those stubs.I'm uncertain whether this is the best way to do things, though.
One alternative is to treat
idbstubs
more like Mypy'sstubgen
, which writes templates for stubs that can be expanded on. This would have the benefits of simplifyingidbstubs
(special_cases.py
could be almost entirely eliminated) and not requiring it and Black to be re-run every timepanda3d-stubs
needs to be modified.Another alternative would be to move in the opposite direction.
idbstubs
could be made to do more of the formatting Black does by itself, negating the need to run Black as often in a different way. This would have the benefit of simplifying the relationship betweenidbstubs
andpanda3d-stubs
, as well as possibly removing the need to store the latter in the repository. (If this approach were taken,idbstubs
would probably also be modified to write the stubs forinterrogatedb
anddtoolconfig
.)The current setup is not without merit, though. It compromises between simple code in
idbstubs
and a simple workflow for changingpanda3d-stubs
. It also means that updating those stubs for a new version of Panda3D is mostly automatic, a benefit shared with the second alternative.There may be more routes that could be taken, and I am open to suggestions and examples of other projects that have dealt with similar decisions.
The text was updated successfully, but these errors were encountered: