-
Notifications
You must be signed in to change notification settings - Fork 1
Add conda packaging support #17
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
base: main
Are you sure you want to change the base?
Add conda packaging support #17
Conversation
- Add conda-recipe directory with meta.yaml for package metadata - Add build.sh for Unix/Linux/macOS conda builds - Add bld.bat for Windows conda builds - Add comprehensive CONDA_PUBLISHING.md documentation - Package successfully built and uploaded to Anaconda.org under Protegrity organization - Users can now install via: conda install -c Protegrity protegrity-developer-python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive conda packaging support to enable distribution of the protegrity-developer-python package through conda channels. The implementation includes conda recipe files, build scripts for multiple platforms, and detailed documentation for maintainers.
- Added conda recipe configuration with package metadata and dependencies
- Created platform-specific build scripts for Unix/Linux/macOS and Windows
- Documented complete workflow for building, testing, and publishing conda packages
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| conda-recipe/meta.yaml | Defines conda package metadata, dependencies, and test configuration |
| conda-recipe/build.sh | Unix/Linux/macOS build script using pip install |
| conda-recipe/bld.bat | Windows build script with error handling |
| CONDA_PUBLISHING.md | Complete guide for building and publishing conda packages with troubleshooting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### Step 1: Navigate to the Project Root | ||
|
|
||
| ```bash | ||
| cd /home/yigalr/projects/pty-dev |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This path appears to be a personal/local directory path (/home/yigalr/projects/pty-dev) that should not be included in documentation. It should be replaced with a generic placeholder like cd /path/to/protegrity-developer-python or simply removed since the build command can be run from any location within the project root.
| cd /home/yigalr/projects/pty-dev | |
| cd /path/to/protegrity-developer-python |
| - python >=3.12.11 | ||
| - pip | ||
| - setuptools >=61.0 | ||
| run: | ||
| - python >=3.12.11 |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Python version constraint >=3.12.11 is overly restrictive. Python patch versions (the third number) are typically used for bug fixes within a minor release, and requiring a specific patch version is unusual unless there's a critical security fix or bug that affects the package. Consider using >=3.12 or >=3.12.0 instead to allow any Python 3.12.x version, which is the more common pattern in conda packages and aligns with the README badge that shows "Python 3.12+".
| - python >=3.12.11 | |
| - pip | |
| - setuptools >=61.0 | |
| run: | |
| - python >=3.12.11 | |
| - python >=3.12 | |
| - pip | |
| - setuptools >=61.0 | |
| run: | |
| - python >=3.12 |
| 2. Comment out or remove the `url` line | ||
| 3. Run the build command from the project root: |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation refers to a url line in the source section that needs to be commented out or removed when building from local source. However, the current meta.yaml file only contains path: .. and no url line exists. This instruction is misleading and should be removed or updated to reflect the actual file content.
| 2. Comment out or remove the `url` line | |
| 3. Run the build command from the project root: | |
| 2. Run the build command from the project root: |
| ``` | ||
|
|
||
| This will: | ||
| - Download the source from PyPI (or use local source if configured) |
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description states "Download the source from PyPI (or use local source if configured)", but the current meta.yaml is configured to use local source (path: ..) and there is no PyPI source URL configured. This is misleading and should be updated to accurately reflect that the recipe builds from local source by default.
| - Download the source from PyPI (or use local source if configured) | |
| - Use the local source directory to build the package (as configured in meta.yaml) |
| @@ -0,0 +1,53 @@ | |||
| {% set name = "protegrity-developer-python" %} | |||
| {% set version = "1.0.0" %} | |||
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The version is hardcoded in the conda recipe, which means it needs to be manually updated whenever the version in pyproject.toml changes. Consider using a dynamic approach to extract the version from pyproject.toml to ensure version consistency and reduce maintenance overhead. You can use Jinja2 to load the version from a file or use {{ load_file_regex(pattern='version = "(.*)"', file='pyproject.toml')[1] }}.
| {% set version = "1.0.0" %} | |
| {% set version = load_file_regex(pattern='version = "(.*)"', file='../pyproject.toml')[1] %} |
| @@ -0,0 +1,4 @@ | |||
| #!/bin/bash | |||
Copilot
AI
Nov 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Unix build script lacks error handling. If the pip install command fails, the script will continue silently. Consider adding set -e at the beginning of the script (after the shebang) to ensure the script exits immediately if any command fails, or add explicit error checking like || exit 1 after the pip install command, similar to the Windows build script.
| #!/bin/bash | |
| #!/bin/bash | |
| set -e |
Summary
This PR adds comprehensive conda packaging support for the protegrity-developer-python package.
Changes
conda-recipe/meta.yamlwith package metadata and build configurationconda-recipe/build.shfor Unix/Linux/macOS buildsconda-recipe/bld.batfor Windows buildsCONDA_PUBLISHING.mdwith complete documentation for building and publishingTesting
conda build conda-recipe/protegrity_developer_pythonandappythonmodules)Installation
Users can now install the package via conda:
Documentation
The
CONDA_PUBLISHING.mdfile includes: