Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
See the [Scikit-HEP Developer introduction][skhep-dev-intro] for a detailed description of best practices for developing Scikit-HEP packages.

[skhep-dev-intro]: https://scikit-hep.org/developer/intro

# Installing pylhe

First create a fork of the `pylhe` repository on GitHub, then clone your fork locally and change into the `pylhe` directory:

```bash
# fork scikit-hep/pylhe
git clone https://github.com/<your_github_username>/pylhe.git
cd pylhe
```

# Setting up a development environment

You can set up a development environment by running:

```bash
pipx install hatch
Comment thread
APN-Pucky marked this conversation as resolved.
Resolved
hatch env create dev
hatch shell dev
```

# Post setup activate of pre-commit

You should prepare pre-commit, which will help you by checking that commits pass required checks:

```bash
pre-commit install # Will install a pre-commit hook into the git repo
```

You can also/alternatively run `pre-commit run` (changes only) or `pre-commit run --all-files` to check even without installing the hook.
Comment thread
APN-Pucky marked this conversation as resolved.
Resolved

# Testing

Use PyTest to run the unit checks:

```bash
pytest
```

# Documentation

In order to produce the documentation webpage locally, you can run the following commands:

```bash
cd docs
hatch run docs:make html
```

Now find the generated documentation in `docs/build/html/index.html`.
You can also run `hatch run docs:make clean` to remove the generated files.
27 changes: 27 additions & 0 deletions developer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Release a new version of the software

## PyPI

For a step-by-step video guide check out the [release video](https://www.youtube.com/watch?v=tsAWDumpcW8)

1. Check that the publishing action creating the wheels and source distribution appear correctly.
2. Go to Actions tab and workflow "Bump version".
3. Run the workflow manually by clicking the "Run workflow" button and adjusting the parameters.
- Set version bump level (i.e. "patch")
- Set new version "X.Y.Z" w/o "v" prefix
- Disable dry run, after you are confident that the workflow is working correctly (i.e. running dry run once).
4. Optionally, check the publishing action again for the new version.
5. Manually, run the publishing action by clicking the "Run workflow" button in order to publish to Test-PyPI.
6. Optionally, inspect the URL returned after Test-PyPI uploading to check the package.
Check that sdist and wheel are available for the new version.
7. Go to the Releases page.
Select "Draft a new release".
8. Pick the tag created by the "Bump version" workflow (here with a "v" prefix) and click "Generate release notes".
Tick "Set as the latest release" if this is the latest release and "Create a discussion" in the Category "Announcements".
9. Click "Publish release".
10. A build and publish to (Test)-PyPI workflow will be triggered automatically it should again upload sdist and wheel to PyPI.

## Conda

1. Wait a few hours for automatic PR https://github.com/conda-forge/pylhe-feedstock following the PyPI release.
2. Review that there are no dependency changes and merge the PR.
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ Homepage = "https://github.com/scikit-hep/pylhe"
"Issue Tracker" = "https://github.com/scikit-hep/pylhe/issues"
"Releases" = "https://github.com/scikit-hep/pylhe/releases"

[tool.hatch.envs.dev]
features = [
"develop",
]

[tool.hatch.envs.docs]
features = [
"docs",
]

[tool.hatch.version]
source = "vcs"

Expand Down
Loading