Skip to content
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

Build FABulous with setuptools #110

Conversation

EverythingElseWasAlreadyTaken
Copy link
Collaborator

@EverythingElseWasAlreadyTaken EverythingElseWasAlreadyTaken commented Sep 8, 2023

I've refactored FABulous to build it with setuptools.

This would allow us to publish FABulous to PyPI.
I've already prepared a little POC and published it on TestPyPI:
https://test.pypi.org/project/FABulous-FPGA/

It was neccessary to rename the package ot FABulous-FPGA, since there is already a fabulous package on PyPI.

You can install it with:

$ python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple FABulous-FPGA

The --extra-index-url is needed since some dependencies are not available on TestPyPI.

Afterward, you can use FABulous as command line tool:

$ FABulous -c demo
$ FABulous demo
$ FABulous --script ./demo/FABulous.tcl

@KelvinChung2000
Copy link
Collaborator

Can you please resolve the merge conflict? Also, since we are moving to setuptools, maybe we should fix the fasm dependency problem mentioned in #60 ?

@KelvinChung2000
Copy link
Collaborator

We had a meeting today, and the following is the summary.

  1. The restructure will affect the current user on how FABulous is being used. As a result, we would like to do a non-silicon-proven stable release so users can track back to the current version. Then, we will merge this pull request. @JakobTernes, please check if anything else needs adding before we can do this. @gatecat, we might need your help as well if we are doing a release.
  2. The FASM fix will be happening later.

@EverythingElseWasAlreadyTaken
Copy link
Collaborator Author

EverythingElseWasAlreadyTaken commented Nov 9, 2023

We had a meeting today, and the following is the summary.

1. The restructure will affect the current user on how FABulous is being used. As a result, we would like to do a non-silicon-proven stable release so users can track back to the current version. Then, we will merge this pull request. @JakobTernes, please check if anything else needs adding before we can do this. @gatecat, we might need your help as well if we are doing a release.

2. The FASM fix will be happening later.

Rebase is done.

@JakobTernes it would be nice if you could check if your changes are still working, since this is currently not covered by the test workflow.

@JakobTernes
Copy link
Collaborator

JakobTernes commented Nov 9, 2023

@EverythingElseWasAlreadyTaken Looks good to me, the results I expect are still being produced.

@KelvinChung2000 There is still an issue that was found with geometry generation for termination tiles, but since FABulator (the graphical frontend) is not yet available, in part because of this issue, it does not really make a difference. So a release with the current state of the geometry generation is fine with me, the results of the geometry generation should just be taken with a grain of salt here and there, which will only be relevant once FABulator is public anyways. Maybe one could add a comment (in the readme.md?) about the geometry generation / gui feature still being experimental? If all of this is not an option you can get back to me via email: [email protected]

Cheers

@KelvinChung2000
Copy link
Collaborator

Let's leave everything like this for now. When FABulator is done, we can combine this as a single release, and then GUI with the new installation method should make better sense than merging this now.

@KelvinChung2000
Copy link
Collaborator

I have started a new branch called FABulous2.0-development. Can we merge this to that branch, so this is available while we can keep the master as is.

@mole99
Copy link
Contributor

mole99 commented Feb 22, 2024

Just a comment: There seem to be a lot of files that have been reformatted (rightfully so!). Maybe we can keep these changes for a PR that introduces a formatter, e.g. black (see here #158) to reduce the noise in the commit history?

@EverythingElseWasAlreadyTaken
Copy link
Collaborator Author

I have started a new branch called FABulous2.0-development. Can we merge this to that branch, so this is available while we can keep the master as is.

Okay, I'll move the PR to the dev branch and rebase it the next days. 👍

@EverythingElseWasAlreadyTaken
Copy link
Collaborator Author

EverythingElseWasAlreadyTaken commented Feb 26, 2024

Just a comment: There seem to be a lot of files that have been reformatted (rightfully so!). Maybe we can keep these changes for a PR that introduces a formatter, e.g. black (see here #158) to reduce the noise in the commit history?

Yes, I tried to fix the most linter issues, at least for every file I've touched.
This still needs some work, but fixes a lot of smaller stuff.

#163 is a great idea! :)

@mole99
Copy link
Contributor

mole99 commented Feb 26, 2024

Thank you! And maybe wait for your rebase until #163 is in master and dev is rebased on top :D

@mole99 mole99 mentioned this pull request Mar 11, 2024
@EverythingElseWasAlreadyTaken EverythingElseWasAlreadyTaken changed the base branch from master to FABulous2.0-development April 24, 2024 10:46
@EverythingElseWasAlreadyTaken
Copy link
Collaborator Author

Is there any progress on #163?

Or maybe we could somehow bring this PR forward to merge it in the 2.0 branch?
It would be nice to have this material as a common ground for my future developments. :)

@mole99
Copy link
Contributor

mole99 commented Apr 27, 2024

#163 has been merged into FABulous2.0-development, so if you build on top of that, I think this PR can also be merged into the 2.0 branch 👍

Is that correct, @KelvinChung2000? Also, maybe it makes sense to lock the master branch so that no one accidentally pushes to it since development now happens on the 2.0 branch?

@mole99
Copy link
Contributor

mole99 commented Apr 27, 2024

I'm thinking about whether the FABulous2.0-development branch is really necessary once this PR has been merged: Users can simply install stable releases from PyPI. Developers target the master branch for new features and open a PR. Once the CI runs through and no regressions are detected, the code can be merged. Whenever enough features have accumulated, a new release can be made on PyPI. Or you could do automatic releases for each new version increment, since the master branch should always be in a stable state.

This would be similar to what we do for https://github.com/efabless/cace

I believe it makes sense to target incremental improvements and not major 2.0, 3.0, etc. releases, as it often takes a long time for users to actually receive improvements. Because the issue with such releases is always: when are they considered done?

@KelvinChung2000
Copy link
Collaborator

Yes, this is my plan. Do a release for the current master, or actually, releasing the version used in the workshop (I don't know are there any difference between them). Once the release is done all the development will happen in master again.

@mole99
Copy link
Contributor

mole99 commented Apr 27, 2024

Awesome, looking forward to it!

In preparation for packaging FABulous with setuptools, we migrate FABulous to a so-called "flat-layout".
This means we add a subfolder FABulous and move all code sources there.

Signed-off-by: Jonas K. <[email protected]>
Signed-off-by: Jonas K. <[email protected]>
Automatically sets the fabulousRoot path if no FAB_ROOT env var is specified.

Add Python interpreter path in file header.

Add main() function.

Signed-off-by: Jonas K. <[email protected]>
@EverythingElseWasAlreadyTaken
Copy link
Collaborator Author

@KelvinChung2000 @mole99 Rebase is done now. Tests are all running without any issues. Would be nice if you could review the changes and merge it into the 2.0-dev branch.

I'll do another cleanup PR later.
For now, I've removed the most cosmetic changes from this PR, since it got too confusing.

Update pyproject.toml to build FABulous package with setuptools.
Use setuptools-scm for autoamtic project version generation.
Add FABulous as package script to make it callable directlty from shell.
Add bit_gen as package script and add main function to it.

Update "fabric_gen" github workflow:
  - Use new FABulous structure
  - Update external actions

Update import statements in all python modules to absolue imports of
FABulous modules and and remove unused imports.

Update gitignore.

Signed-off-by: Jonas K. <[email protected]>
Update documentation to install and use FABulous with the new setup.

Signed-off-by: Jonas K. <[email protected]>
@KelvinChung2000 KelvinChung2000 merged commit ed1f12e into FPGA-Research:FABulous2.0-development May 7, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants