Skip to content
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

Add build configuration #5

Merged
merged 20 commits into from
May 14, 2024

Conversation

BNJHope
Copy link
Collaborator

@BNJHope BNJHope commented May 13, 2024

Overview

To make the CI/CD workflow easier to distribute and integrate in various pipelines, this adds the configuration to generate a Python artefacts using hatchling as a build backend for Python wheels

Features

  • Add pyproject.toml which includes the build configuration for the CICD package
    • requirements[-dev].txt have been removed, with dependency information now in the pyproject.toml
  • Add build and publish GitHub Actions workflow that will be triggered on merges to main - it will:
    • Generate a .whl and source build too for the package
    • Create a GitHub Release on the repo that publishes the .whl
  • Rename cicd directory to ib_cicd

Testing

Ensuring CICD library code is accessible from the built package

Steps

  • Run the build process for the package
    • Created a venv
    • Follow guidelines for building the artefact from python3 -m build in the environment to generate the .whl file
    • Create a test Python project in my local environment
    • Install the generated .whl within the venv of that local project and ensure library contents was accessible after installation

 Outcome: Successful

Side effect: VSCode is happy when it uses the venv for its Python extension environment, has Intellisense over it etc

Screenshot 2024-05-13 at 10 21 12

Ensuring CICD CLI Tool is Runnable after install from

Steps

  • Run the build process for the package
    • Created a venv
    • Follow guidelines for building the artefact from python3 -m build in the environment to generate the .whl file
    • Create a test Python project in my local environment
    • Install the generated .whl within the venv of that local project and ensure the CLI can run as expected

 Outcome: Successful

  • No import errors on running CLI tool after install

Ensuring GitHub Release is created as expected

Steps

  • Run the build/publish action in my own fork of the project with the created configurations

Outcome: Successful

@BNJHope BNJHope marked this pull request as ready for review May 13, 2024 11:21
@BNJHope BNJHope force-pushed the sdlc/add-build-configuration branch from af385d7 to 6fb17d5 Compare May 13, 2024 15:32
&& chmod +x dasel

- name: Set package version
# Get the Python package version from the pyproject.toml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we need to manually update the version?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes - the workflow will fail though if it isn't changed before merging into main because it shouldn't overwrite existing tags, so users will get warnings/failures if it hasn't been adjusted.

(We should provide a better system for this in the future)

@BNJHope BNJHope merged commit 8650b65 into instabase:main May 14, 2024
2 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