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

Reduce the addition and maintenance of new projects #755

Open
moe-ad opened this issue Nov 13, 2024 · 7 comments
Open

Reduce the addition and maintenance of new projects #755

moe-ad opened this issue Nov 13, 2024 · 7 comments
Assignees

Comments

@moe-ad
Copy link
Contributor

moe-ad commented Nov 13, 2024

A number of files (e.g. pyproject.toml, links.py, examples.rst to name a few) have to be edited manually each time there is a new addition/subtraction to/from the pyansys metapackage. This issue will address removing this manual process by:

  1. Adding a new file (a .yml for example) which will be the only data source that will need maintenance.
  2. Creating a setup.py that will update every other file automatically as needed.
@moe-ad moe-ad self-assigned this Nov 13, 2024
@RobPasMue
Copy link
Member

RobPasMue commented Nov 13, 2024

I raised my concerns to @jorgepiloto yesterday... I don't think this is a good idea since it will make this Python package to no longer work as a normal, modern Python package, and also dependabot will probably stop working properly...

I know it is time consuming and implies touching a lot of places whenever a new library is added but I wouldn't move from pyproject.toml to setup.py. Most of the affected files are typically in the docs. We could restrict this "new file" approach only to the documentation if you prefer but still, there are many nuances to take into account...

@greschd
Copy link
Member

greschd commented Nov 13, 2024

I raised my concerns to @jorgepiloto yesterday... I don't think this is a good idea since it will make this Python package to no longer work as a normal, modern Python package, and also dependabot will probably stop working properly.

Agreed, this is a step backwards with respect to this being a modern Python package.

As a simple quality-of-life improvement, a pre-commit hook which either checks or updates the various places (taking pyproject.toml as input) might help.
This can be a simple Python script which is executed as a local hook.

@RobPasMue
Copy link
Member

Yep I agree! That would be a much easier way to handle it. Or a dedicated script that you just run when you need to add a new library.

@greschd
Copy link
Member

greschd commented Nov 13, 2024

Something closer to the original suggestion which I'd also consider workable is:

  • a source .yml
  • template files for links.py, examples.rst etc, for example in Jinja2 format
  • a pre-commit hook which interpolates the templates and produces the actual files
  • for pyproject.toml the update would be a bit more complicated, as we'd want to keep it as source of truth for the versions (to allow dependabot to work). Could be as simple as a consistency check here.

So worst case, you would have to add the library in two places (pyproject.toml, and the source-of-truth file), and get a CI error if they don't match.

@RobPasMue
Copy link
Member

Works too =)

@moe-ad
Copy link
Contributor Author

moe-ad commented Nov 15, 2024

Thank you both for your valuable inputs @greschd and @RobPasMue. We will start exploring doing this in a way similar to your suggestions. Once the final solution becomes available, I will tag you both for additional inputs.

@jorgepiloto
Copy link
Member

jorgepiloto commented Nov 15, 2024

Let's start by creating the YML file:

projects:

  pymapdl:
    name: ...    
    repository: ...
    thumbnail: ...

  ...

We'll read this from the conf.py and use Jinja to short the content of the RST files.

@jorgepiloto jorgepiloto changed the title Migration to setup.py Reduce the addition and maintenance of new projects Nov 18, 2024
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

No branches or pull requests

4 participants