Skip to content

Deploy to Pypi

nh916 edited this page Nov 17, 2023 · 8 revisions

Manually Deploy to Pypi

Create GitHub Release

Merging develop branch to main branch is considered a release

  1. Clone repo
    1. git clone` CRIPT SDK Repository
  2. Bump the ‘version’ of the SDK within setup.cfg appropriately and in compliance to Semantic Versioning
  3. Merge develop branch into main branch on GitHub
    • The main branch should always reflect what is deployed to CRIPT Pypi
    • Warning: Be sure to always do a regular merge on GitHub instead of a Squash & Merge because Squash & Merge will create merge conflicts the next time we need to merge develop into main

  4. Create a new release with a new tag on and deploy it to GitHub releases
  5. All releases should have clear release notes written and for the user and what concerns them
    • Any breaking changes should be clearly written and a step by step guide to migrating should be provided
      • The user should never be left in confusion as to what the new release means, the changes, and how to upgrade
  6. Make an announcement on the appropriate channels such as CRIPT Python SDK discussions

Resolving develop and main Merge Conflict

Resolve Merge Conflicts Normally

This is the most recommended way or fixing the merge conflicts. Fix merge conflicts either by fixing them in GitHub editor or via git merge <branch name>.

Force Push develop to main

If there are any better practices please feel free to update this wiki with the best practices. I think this is not the best practice, but this is what we were able to figure out at the time.

Previously in release of v2.0.0 we merged develop into main via squash & merge, which later created a ton of merge conflicts. The way we fixed these merge conflicts was via force pushing develop into main and completely overwriting main branches history with develop. Then, deleting our local main branch, and fetching it again from the repository. It is recommended to make an announcement on the discussions page so that everyone using the SDK main branch, can delete their local copy and pull down the new one.

Terminal Commands to Force Push Develop Onto Main

Force Push Develop Onto Main

git checkout develop
git push origin develop:main --force     # force push develop onto main

Refresh Main From Repo

git branch -d main   # delete the local main branch
git fetch origin     # fetch the latest branches from remote
git checkout main    # checkout the new main which is now the same as develop

Create a Pypi Release

  1. Checkout to main branch
    1. git checkout main
  2. Install dependencies
    1. pip install build
    2. pip install twine
  3. Build the package
    1. Python -m build
  4. Deploy with twine
    1. twine upload dist/*

Writing Release Notes

documentation/tutorial coming soon...


Resources