Thank you for your interest in contributing to PyCTools! This document provides guidelines for contributing to the project, including how to report bugs, suggest features, submit pull requests, and create releases.
Please read and follow our Code of Conduct.
If you encounter a bug or have a feature request, please open an issue on the GitHub issue tracker.
- Bug Reports: Include detailed steps to reproduce, expected behavior, actual behavior, and environment details.
- Feature Requests: Clearly describe the feature, its use case, and potential implementation approach.
- Fork the repository
- Create a new branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test your changes
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Wait for review and address any feedback
- When asked, make sure to upload the 3 required files for the release:
dist.zip- The compressed archive with DLL filesdist.zip.sha256- The hash verification file- The wheel file (e.g.,
pyctools-0.2.0b0-py3-none-any.whl)
- Follow PEP 8 style guidelines for Python code
- Write comprehensive docstrings for all functions and classes
- Include type hints where appropriate
- Comment complex code sections
- Ensure your code works
- Update documentation as needed
- Wait for a maintainer approve your PR
Creating a new release of PyCTools involves several steps to ensure proper packaging and distribution.
- Update version in
pyCTools/__init__.py - Update documentation if needed
- Ensure running all distribution scripts and getting the required files ready for the release
-
Enter the
tooldirectory:cd tool
-
Run
compilerHelper.ps1to compile the C code and generate the necessary DLL files insidepyCTools:.\compilerHelper.ps1
-
This script will:
- Compile the C code using MSVC
- Generate the required DLL files in the
pyCTools/bin/directory - Ensure that both x86 and x64 architectures are supported
-
Run the setupHelper.py script to build the wheel package:
python setupHelper.py
-
This process will:
- Create the wheel file in the
dist/wheelsdirectory - Provide instructions for the next steps
- Supply the assumed
pipcommands for both local and release use
- Create the wheel file in the
-
Run the distributionHelper.ps1 PowerShell script to prepare release files:
.\distributionHelper.ps1
-
This script:
- Copies DLL files with proper naming conventions from
pyCTools/bin/x64/andpyCTools/bin/x86/ - Creates dist.zip containing the binary files copied
- Generates SHA256 hashes for verification
- Copies DLL files with proper naming conventions from
-
In the GitHub repository, go to "Releases" and click "Create a new release"
-
Use the version tag suggested by setupHelper.py (e.g.,
1.0.0or0.2.0-beta)- This is very important to ensure the release is properly versioned and the
pipcommand works correctly.
- This is very important to ensure the release is properly versioned and the
-
Use the template from the below for the release description:
- Fill in the version number
- Add a descriptive title
- List key highlights and changes
- Include installation instructions
-
Upload the three required files (maintainers will ask you to upload these files to the PR):
dist.zip- The compressed archive with DLL filesdist.zip.sha256- The hash verification file- The wheel file (e.g.,
pyctools-0.2.0b0-py3-none-any.whl)
-
Publish the release
The release structure must follow this format:
-
The
dist.zipfile must contain:x64/folder with 64-bit DLLs namedname_x64.dllx86/folder with 32-bit DLLs namedname_x86.dll- The other generated files (if any) aren't of high importance but should be included for completeness
-
The wheel file must be unchanged and exactly as generated by the
setupHelper.pyscript -
Always include the
dist.zip.sha256hash file for thedist.zipto ensure integrity -
The release notes must include:
- Installation instructions with the correct pip command
- Highlights of the changes
- Important notes about DLL structure requirements
- File descriptions table
Tip
Use the provided release notes template to ensure consistency and completeness in your release descriptions.
Click to expand the template
# **pyCTools Release - {RELEASE_TITLE}**
---
### Installation of v{VERSION}
Here is the pip command:
\`\`\`
pip install https://github.com/DefinetlyNotAI/PyCTools/releases/download/{TAG_NAME}/{WHEEL_FILENAME}
\`\`\`
---
{RELEASE_DESCRIPTION}
**Highlights:**
* **{HIGHLIGHT_1}:** {HIGHLIGHT_1_DESCRIPTION}
* **{HIGHLIGHT_2}:** {HIGHLIGHT_2_DESCRIPTION}
* **{HIGHLIGHT_3}:** {HIGHLIGHT_3_DESCRIPTION}
* **{HIGHLIGHT_4}:** {HIGHLIGHT_4_DESCRIPTION}
* **{HIGHLIGHT_5}:** {HIGHLIGHT_5_DESCRIPTION}
{ADDITIONAL_NOTES}
---
> [!IMPORTANT]
> ## Attached will be a ZIP file that contains the built DLL's required by the python scripts,
> YOU MUST keep the DLL structure the same: `dist/{architecture_type}/{name}_{architecture_type}.dll`
>
> You will still find the other generated files if you want to play around with them, attached is also the ZIP's hash if you want to check the validity
>
> This supports Windows - both the `x86` (32-bit) and `x64` (64-bit) architecture, and the python wrappers also auto-detect the required architecture to use for your system, so as long as the dist is available, all is good
>
> You can place the `dist` folder in the same directory as the Python library.
> [!TIP]
> You can also just run the [`tool/compilerHelper.ps1`](https://github.com/DefinetlyNotAI/PyCTools/blob/main/tool/compilerHelper.ps1) tool where as long as you have the `cl.exe` from Microsoft Visual Studio `MSVC` toolchain.
>
> You can just check the source code of the `ps1` tool for the paths it checks for the files!
---
| File Name | Description | Notes |
|--------------------|------------------------------------------------------|-----------------------------------------------------------------------|
| `dist.zip` | Compressed archive containing required binaries | Uses ZIP compression. Contains all DLLs needed for the Python wrapper |
| `dist.zip.sha256` | SHA-256 hash file for verifying `dist.zip` integrity | Ensure file hasn't been tampered with or corrupted |
| `{WHEEL_FILENAME}` | WHL File for pip to install the library | Allows easy pip installation |
---
**Full Changelog**: https://github.com/DefinetlyNotAI/PyCTools/compare/{PREVIOUS_TAG}...{TAG_NAME}- Update documentation website if applicable
- Close related issues that were addressed in the release