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

Tracker for first PyPI release #26

Closed
14 of 16 tasks
santacodes opened this issue Jul 18, 2024 · 9 comments · Fixed by #28
Closed
14 of 16 tasks

Tracker for first PyPI release #26

santacodes opened this issue Jul 18, 2024 · 9 comments · Fixed by #28

Comments

@santacodes
Copy link
Collaborator

santacodes commented Jul 18, 2024

Overview

This issue tracks all the tasks that need to be checked before the first PyPI release for the pybamm-cookie template.

Tasks

Migrations

Features

Misc

PS

If there is something else to add or is missing, please feel free to edit this comment and append it.

@santacodes santacodes pinned this issue Jul 18, 2024
This was referenced Jul 19, 2024
@santacodes santacodes reopened this Jul 19, 2024
arjxn-py pushed a commit that referenced this issue Jul 23, 2024
+ Added `git` initialisation hooks in the template to automatically
initialise a `git repository` when a `generated project` is created by
`cookiecutter`.
+ Added a default `main` branch parameter for git repository
initialisation.

Subtask - #26
@santacodes
Copy link
Collaborator Author

@Saransh-cpp @agriyakhetarpal @arjxn-py I looked into copier and supporting it would take a fair bit of change in the template.

  • Modifying the jinja structure with respect to what copier supports, i.e. we would have to change all the variables mostly with the {{cookiecutter.key}}. This should be easy though, we don't have to change much, just rename things from {{ cookiecutter.something }} -> {{ something }}.
  • Changing the test_template_generation completely, unfortunately, we would have to rewrite this completely because cookiecutter and copier work differently.
  • Hooks have to be changed though I feel copier has better support for that, we don't have to write some kind of a script and add it to a hooks/ directory, rather we could just add it in the coper.yml file under the tasks key.

I think that is mostly the gist of the copier migration/support, I would prefer we completely move to copier rather than just supporting them both as we are also giving the users a cli interface, and copier already provides a library/API for generating the project. I saw some pytest-copier libraries for testing, but I felt like they weren't maintained, but that was also the case with pytest-cookies so I think it might be reliable because we will just be using them for 2 test cases.

@agriyakhetarpal
Copy link
Member

Thanks for sharing your thoughts, @santacodes. I agree that while migrating to copier is a lot of work, it's useful work, and we would be better off supporting just one tool, as is the case for the CLI. We would be glad to review these changes if you could put together a PR!

Regarding the hooks, I think many of them are supported through extensions for copier, which we can selectively enable/install based on our project's requirements. copier also supports updating a generated project from an updated template, but that can be picked up in a follow-up PR.

@Saransh-cpp
Copy link
Member

Looking at this issue, gitlab-ci.yml is not a priority. We should go ahead with the release without adding support for gitlab.

agriyakhetarpal added a commit that referenced this issue Aug 15, 2024
## Additions
+ Added a basic `cli` with an optional `--path` argument defining the
path generated project should reside within.
+ Added basic documentation for `cli` usage in `cli.py` and `README.md`.

## Removals
- Removed `models`, `entry points`, and `parameter sets` from the
project as they are now populated in the template.
- Removed the `project-tests` from `noxfile` and updated workflow to
only test the template.
- Removed the entry points from `pyproject.toml` and `pybamm` as a
dependency in the project.

## Usage 
To test this, check out this branch and inside the repository and do a
local `pipx` installation on your machine.
```bash 
git clone https://github.com/santacodes/pybamm-cookiecutter -b cli
cd pybamm-cookiecutter/
pipx install . 
```
After installation, the `CLI` will be available systemwide and can be
accessed using the `pybamm-cookiecutter` command.
For help references add the `-h` or `--help` flag, e.g.
`pybamm-cookiecutter --help` which would prompt with all the available
arguments.

Sub-task #26

---------

Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
agriyakhetarpal added a commit that referenced this issue Aug 15, 2024
Changed all instances of `pybamm-cookiecutter` to `pybamm-cookie`.

#26

---------

Co-authored-by: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com>
@santacodes
Copy link
Collaborator Author

@Saransh-cpp @agriyakhetarpal @arjxn-py Do we need example notebooks for this project? I think it was discussed previously in one of the meetings and I added it to this tracker list.

@agriyakhetarpal
Copy link
Member

I feel an example notebook would be nice to showcase since it would give people an idea of how to add docs and integrate MyST-NB with their project. However, I don't think it is a blocker for the first release, and it can be picked up anytime.

@agriyakhetarpal
Copy link
Member

agriyakhetarpal commented Aug 15, 2024

Looking at the tracker, all we have left is a logo (nice-to-have) and a publishing workflow (needed). You can set up an environment in the repository, and create a project named pybamm-cookie on PyPI for now using a personal account, wherein we can configure trusted publishing (feel free to add us as authors there if you would like additional pairs of eyes). We can then move it to a PyBaMM-specific organisation whenever it gets set up.

@santacodes
Copy link
Collaborator Author

Looking at the tracker, all we have left is a logo (nice-to-have) and a publishing workflow (needed). You can set up an environment in the repository, and create a project named pybamm-cookie on PyPI for now using a personal account, wherein we can configure trusted publishing (feel free to add us as authors there if you would like a additional pairs of eyes). We can then move it to a PyBaMM-specific organisation whenever it gets set up.

Sure that sounds good!

@brosaplanella
Copy link
Member

Sorry I have been disconnected these past to weeks. All the progress looks amazing, well done!

@agriyakhetarpal
Copy link
Member

Now that the first (and second) releases are up on PyPI, we should be in a safe position to close this. Thanks, @santacodes!

@santacodes santacodes unpinned this issue Aug 30, 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

Successfully merging a pull request may close this issue.

4 participants