Skip to content

Conversation

@yigal-rozenberg
Copy link

Summary

This PR adds comprehensive conda packaging support for the protegrity-developer-python package.

Changes

  • ✅ Added conda-recipe/meta.yaml with package metadata and build configuration
  • ✅ Added conda-recipe/build.sh for Unix/Linux/macOS builds
  • ✅ Added conda-recipe/bld.bat for Windows builds
  • ✅ Added CONDA_PUBLISHING.md with complete documentation for building and publishing

Testing

  • Package successfully built using conda build conda-recipe/
  • All import tests passed (both protegrity_developer_python and appython modules)
  • Package successfully uploaded to Anaconda.org under Protegrity organization

Installation

Users can now install the package via conda:

conda install -c Protegrity protegrity-developer-python

Documentation

The CONDA_PUBLISHING.md file includes:

  • Prerequisites and setup instructions
  • Building and testing procedures
  • Publishing workflow to Anaconda.org
  • Troubleshooting guide
  • CI/CD integration examples

- 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
Copilot AI review requested due to automatic review settings November 11, 2025 13:41
Copilot finished reviewing on behalf of yigal-rozenberg November 11, 2025 13:44
Copy link

Copilot AI left a 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
Copy link

Copilot AI Nov 11, 2025

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.

Suggested change
cd /home/yigalr/projects/pty-dev
cd /path/to/protegrity-developer-python

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +22
- python >=3.12.11
- pip
- setuptools >=61.0
run:
- python >=3.12.11
Copy link

Copilot AI Nov 11, 2025

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+".

Suggested change
- python >=3.12.11
- pip
- setuptools >=61.0
run:
- python >=3.12.11
- python >=3.12
- pip
- setuptools >=61.0
run:
- python >=3.12

Copilot uses AI. Check for mistakes.
Comment on lines +128 to +129
2. Comment out or remove the `url` line
3. Run the build command from the project root:
Copy link

Copilot AI Nov 11, 2025

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.

Suggested change
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:

Copilot uses AI. Check for mistakes.
```

This will:
- Download the source from PyPI (or use local source if configured)
Copy link

Copilot AI Nov 11, 2025

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.

Suggested change
- 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)

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,53 @@
{% set name = "protegrity-developer-python" %}
{% set version = "1.0.0" %}
Copy link

Copilot AI Nov 11, 2025

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] }}.

Suggested change
{% set version = "1.0.0" %}
{% set version = load_file_regex(pattern='version = "(.*)"', file='../pyproject.toml')[1] %}

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,4 @@
#!/bin/bash
Copy link

Copilot AI Nov 11, 2025

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.

Suggested change
#!/bin/bash
#!/bin/bash
set -e

Copilot uses AI. Check for mistakes.
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 this pull request may close these issues.

2 participants