Skip to content

Conversation

@pangpang20
Copy link
Collaborator

Description

This PR introduces a GitHub Actions workflow to automate the build and release process for the gaussdb, gaussdb-pool, and isort-gaussdb packages. It updates project metadata in pyproject.toml and README.rst files to correct URLs, descriptions, and version numbers. Additionally, the packages have been successfully published to PyPI, making them available for installation via pip. The changes streamline the release process, improve documentation consistency, and ensure accessibility via PyPI.

Changes Made

  • Added GitHub Actions Workflow (release.yml):
    • Created .github/workflows/release.yml to automate building and releasing wheel files for gaussdb, gaussdb-pool, and isort-gaussdb.
    • Triggers on tags matching v*.*.* (e.g., v1.0.0.dev2).
    • Steps include:
      • Checking out the source code.
      • Setting up Python 3.9.
      • Installing build tools (setuptools, wheel, build).
      • Building wheel files in gaussdb, gaussdb_pool, and tools/isort-gaussdb directories.
      • Collecting artifacts into all_dist/.
      • Uploading wheels to GitHub Releases using softprops/action-gh-release@v1.
  • Updated gaussdb/pyproject.toml:
    • Changed version from 1.0.0.dev1 to 1.0.0.dev2.
    • Updated description to "GaussDB database adapter for Python".
    • Corrected project URLs to psycopg.org instead of gaussdb.org.
    • Removed outdated optional dependencies (gaussdb-c, gaussdb-binary).
    • Removed version synchronization comments, assuming tools/bump_version.py is used.
  • Updated gaussdb_pool/pyproject.toml:
    • Updated project URLs to psycopg.org for consistency.
  • Updated gaussdb/README.rst:
    • Fixed typo: changed "successor of psycopg2_" to "successor of psycopg2".
  • Updated tools/isort-gaussdb/README.rst:
    • Updated GaussDB link to https://www.huaweicloud.com/product/gaussdb.html.
  • Published to PyPI:

Why

  • Automation: The GitHub Actions workflow automates building and releasing wheel files, reducing manual effort and ensuring consistency.
  • Versioning: Bumping gaussdb to 1.0.0.dev2 reflects ongoing development and aligns with the latest changes.
  • Consistency: Updating URLs to psycopg.org aligns with the upstream psycopg3 project (as these packages appear to be forks or rebrands). The Huawei Cloud GaussDB link in isort-gaussdb points to the correct product page.
  • Documentation: Fixing typos and updating descriptions improves clarity for users and developers.
  • PyPI Availability: Publishing to PyPI makes the packages easily accessible to users via pip install, simplifying installation.
  • Cleanup: Removing outdated dependencies and comments streamlines configuration and encourages use of tools/bump_version.py.

Testing

  • Local Testing:
    • Built packages locally using python -m build in gaussdb, gaussdb_pool, and tools/isort-gaussdb.
    • Verified wheel files (*.whl) were generated in dist/ directories.
    • Installed wheels in a Python 3.9 virtual environment:
      python3 -m venv test_env
      source test_env/bin/activate
      pip install --upgrade pip
      pip install gaussdb-1.0.0.dev2-py3-none-any.whl gaussdb_pool-1.0.0.dev1-py3-none-any.whl isort_gaussdb-0.0.1-py3-none-any.whl --no-index
      python -c "import gaussdb; print(gaussdb.__version__)"  # Outputs: 1.0.0.dev2
    • Confirmed imports for gaussdb_pool and isort_gaussdb.
  • PyPI Installation:
    • Tested installation from PyPI:
      python3 -m venv test_env
      source test_env/bin/activate
      pip install --upgrade pip
      pip install isort-gaussdb
      pip install gaussdb
      pip install gaussdb-pool
      python -c "import gaussdb; print(gaussdb.__version__)"  # Outputs: 1.0.0.dev2
    • Verified all packages import correctly and function as expected.
  • Workflow Testing:
    • Pushed a test tag (v1.0.0.dev2-test) to a test branch to trigger the workflow.
    • Confirmed the workflow:
      • Built wheels for all three packages.
      • Collected artifacts in all_dist/.
      • Uploaded wheels to a draft GitHub Release.
    • Checked workflow logs for errors and verified artifacts on the release page.
  • ARM Compatibility (EulerOS, aarch64):
    • Tested installation on EulerOS (ARM) using Python 3.9.
    • Confirmed py3-none-any wheels are compatible and install correctly from both local files and PyPI.
  • Documentation:
    • Verified updated URLs (psycopg.org, huaweicloud.com) are accessible.
    • Checked README.rst renders correctly with updated text.

Additional Notes

  • PyPI Publication:
  • Versioning: Ensure tools/bump_version.py is used for future version updates to maintain consistency across pyproject.toml files.
  • GaussDB vs. Psycopg: The packages appear to be forks or rebrands of psycopg3. Consider clarifying this relationship in the repository description or documentation.
  • x86_64/ARM Support: The py3-none-any wheels are platform-independent, suitable for EulerOS (x86_64/ARM). If native extensions are added later, ensure x86_64/ARM compatibility.
  • Previous Issues: Earlier installations had issues with external paths (/opt/gaussdb_driver) and --extra-index-url warnings. Using --no-index for local installs or PyPI avoids these. Run pip config unset global.extra-index-url if warnings persist.
  • Usage Instructions:
    To install the packages from PyPI:
    python3 -m venv myvenv
    source myvenv/bin/activate
    pip install --upgrade pip
    pip install isort-gaussdb
    pip install gaussdb
    pip install gaussdb-pool

Release Commands

To create and push a release tag for v1.0.0.dev2:

git tag v1.0.0.dev2
git push origin v1.0.0.dev2

This triggers the Build and Release workflow, building and uploading the wheels to a GitHub Release. The wheels are already published to PyPI, so no additional PyPI upload is needed unless further changes are made.

@5xuanwen 5xuanwen merged commit 9955a5b into HuaweiCloudDeveloper:master Jun 28, 2025
3 checks passed
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