Metadata-Version: 2.4
Name: michis_python_sammlung
Version: 0.8.1
Summary: Personal collection of mostly QT related stuff
Author: Michael Mischko
License-Expression: MIT
Project-URL: Homepage, https://github.com/mischkomichael/Michis_python_sammlung
Project-URL: Repository, https://github.com/mischkomichael/Michis_python_sammlung
Project-URL: Issues, https://github.com/mischkomichael/Michis_python_sammlung/issues
Keywords: pyqt6,widgets,gui
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: PyQt6<7,>=6.11

# Publishing a New Release

## Prerequisites

* Maintain project metadata in `pyproject.toml`.
* Keep the project in a dedicated virtual environment (`.venv`).
* Runtime dependencies are declared in `pyproject.toml` under `dependencies`, **not** by freezing the virtual environment.
* The GitHub repository is connected to the existing PyPI project via **Trusted Publishing**.

## Local Build

Build the package locally before creating a release:

```bash
python -m build
```

This creates:

```
dist/
    package_name-x.y.z.tar.gz
    package_name-x.y.z-py3-none-any.whl
```

Optionally verify the package:

```bash
python -m twine check dist/*
```

## Releasing

1. Update the version in `pyproject.toml`.

   Example:

   ```toml
   version = "1.2.3"
   ```

2. Commit and push the changes.

   ```bash
   git add .
   git commit -m "Release 1.2.3"
   git push
   ```

3. Create a matching Git tag.

   ```bash
   git tag v1.2.3
   git push origin v1.2.3
   ```

4. GitHub Actions builds the package and publishes it to PyPI.

---

# Important Caveats

## Always increase the version

PyPI does **not** allow uploading a package with the same version twice.

Every release must have a unique version number.

---

## If the GitHub Action fails because the version was wrong

Simply pressing **Re-run jobs** is **not sufficient** if the commit itself is incorrect.

Instead:

1. Fix `pyproject.toml`.

2. Commit and push the fix.

3. Delete the old tag locally.

   ```bash
   git tag -d v1.2.3
   ```

4. Delete the tag on GitHub.

   ```bash
   git push origin :refs/tags/v1.2.3
   ```

5. Create the tag again on the corrected commit.

   ```bash
   git tag v1.2.3
   git push origin v1.2.3
   ```

This triggers the workflow again using the corrected source.

---

# Common Build Issues

### Missing README

If `pyproject.toml` contains

```toml
readme = "README.md"
```

then `README.md` must exist.

---

### License configuration

Use the modern license expression, for example:

```toml
license = "MIT"
```

Do **not** also include the old license classifier:

```toml
"License :: OSI Approved :: MIT License"
```

Modern versions of `setuptools` reject this combination.

---

# Useful Commands

Build:

```bash
python -m build
```

Check package:

```bash
python -m twine check dist/*
```

Delete local release tag:

```bash
git tag -d vX.Y.Z
```

Delete remote release tag:

```bash
git push origin :refs/tags/vX.Y.Z
```

Create and push release tag:

```bash
git tag vX.Y.Z
git push origin vX.Y.Z
```
