Skip to content

Make tccbox an optional dependency - #752

Open
MridulS wants to merge 1 commit into
SasView:masterfrom
MridulS:make-tccbox-optional
Open

Make tccbox an optional dependency#752
MridulS wants to merge 1 commit into
SasView:masterfrom
MridulS:make-tccbox-optional

Conversation

@MridulS

@MridulS MridulS commented Aug 19, 2026

Copy link
Copy Markdown

Trying to fix conda-forge/sasmodels-feedstock#19

From what I understand tccbox is only an optional dep for windows codepath? This PR exposes it through the Windows-only tinycc extra, and update CI to validate the resulting wheel metadata.

@codescene-access codescene-access Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No quality gates enabled for this code.

See analysis details in CodeScene

Quality Gate Profile: Custom Configuration
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.

@pkienzle

Copy link
Copy Markdown
Contributor

Can you instead modify pyproject.toml requires to "tccbox; sys_platform == 'win32'" ?

@MridulS

MridulS commented Aug 19, 2026

Copy link
Copy Markdown
Author

Hmm, I'm a bit confused as why tinybox is a build-system requirement? It only seems to be used during runtime by kerneldll.py, and if it's in build-system, tinybox is actually never installed when we do pip install sasmodels on a windows machine. It's also declared in build_tools/requirements.txt so the wheel adds that to the metadata as a requirement.

@pkienzle

Copy link
Copy Markdown
Contributor

The wheel includes the docs which includes a png for each model which is created by running the model. This requires either a compiler or opencl/cuda, hence tccbox is a build requirement.

Doc build is also run as part of CI so tccbox may be needed there as well.

bumps isn't required. I mock the necessary symbols so that bumps_model can be imported during doc build and doc test, but with bumps in the requirements this code path never gets tested. Since sasview independently requires bumps this isn't much of an issue.

Note: For a list of packages that depend on sasmodels, see the sasmodels pypimap

@MridulS

MridulS commented Aug 19, 2026

Copy link
Copy Markdown
Author

Thanks for the explanation! I did test building without tccbox in build-requires on a windows runner https://github.com/MridulS/sasmodels-windows-ci/actions/runs/32279909247/job/96155969517 and it seems happy. I'm happy to just put it back in pyproject.toml but I am biased towards removing deps if not absolutely required :)

@pkienzle

Copy link
Copy Markdown
Contributor

Does modifying the requirements file with "tccbox; sys_platform == 'win32'" to limit tccbox to windows solve the feedstock problem?

Or does the feedstock have its own version of a requirements file that has to be kept in sync with pyproject.toml + build_tools/requirements.txt*?


columnize is optional. I have my own implementation that gives identical results.

Check by adding raise ImportError to the sasmodels/compare.py:columnize import statement and running

python -m sasmodels.models -models
python -m sasmodels.list_pars

Feel free to remove the dependency from the code and requirements. It isn't used by sasview.

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.

2 participants