Skip to content

Adjust packaging of catalog games into Python build.#828

Merged
tturocy merged 3 commits intomasterfrom
issue_823
Mar 25, 2026
Merged

Adjust packaging of catalog games into Python build.#828
tturocy merged 3 commits intomasterfrom
issue_823

Conversation

@tturocy
Copy link
Copy Markdown
Member

@tturocy tturocy commented Mar 25, 2026

This makes a few adjustments to how we include the catalog games in the Python build.

Support for 'package data' in Python isn't great currently, and further we have a desire to keep the catalog
games elsewhere
in our tree and not embedded inside the
Python source.

Our solution is this:

  • We have a custom build class, which is responsible for copying the contents of the catalog directory from where it lives into the build directory.
  • We put this in "catalog_data" to avoid clashes with e.g. just having a "catalog" source file or module.

The extra build step is moderately annoying but
straightforward.
However, it avoids e.g. pip thinking that the
catalog data is Python code and complaining
about the package not being listed.

Closes #823.

This makes a few adjustments to how we include the
catalog games in the Python build.

Support for 'package data' in Python isn't great currently,
and further we have a desire to keep the catalog
games elsewhere
in our tree and not embedded inside the
Python source.

Our solution is this:
* We have a custom build class, which is responsible for copying
  the contents of the catalog directory
  from where it lives into the build directory.
* We put this in "catalog_data" to avoid clashes with e.g. just having a "catalog" source file or module.

The extra build step is moderately annoying but
straightforward.
However, it avoids e.g. `pip` thinking that the
catalog data is Python code and complaining
about the package not being listed.

Closes #823.
@tturocy tturocy linked an issue Mar 25, 2026 that may be closed by this pull request
@tturocy
Copy link
Copy Markdown
Member Author

tturocy commented Mar 25, 2026

@edwardchalstrey1 Here's a candidate solution to the issue. I think it's coherent and it's resolved the warning for me. It is slightly flddly but that's the cost of us wanting to be able to pull the catalog data from elsewhere (which we will definitely want to do, as someday it will possibly be its own repo which we e.g. refer to by a submodule!)

Question: Do we need to memorialise this anywhere in the developer documentation?

Copy link
Copy Markdown
Member

@edwardchalstrey1 edwardchalstrey1 left a comment

Choose a reason for hiding this comment

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

Great, this solution works for me!

Regarding docs, the process for updating the catalog is unchanged, however I did add the header "The catalog module" before our discussion, which is now out of date. This could either be updated or simply removed, depending how useful you think it is for devs on the project to read vs just inspecting the codebase.

@tturocy tturocy merged commit 1ce412b into master Mar 25, 2026
26 checks passed
@tturocy tturocy deleted the issue_823 branch March 25, 2026 12:23
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.

[PyGambit]: Configuration of catalog

2 participants