Skip to content

Commit

Permalink
Merge branch 'development' of github.com:Scale3-Labs/langtrace-python…
Browse files Browse the repository at this point in the history
…-sdk into development
  • Loading branch information
alizenhom committed Mar 28, 2024
2 parents c5a55c6 + 0d13028 commit d87c71e
Show file tree
Hide file tree
Showing 7 changed files with 676 additions and 68 deletions.
21 changes: 21 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[flake8]
ignore =
# line too long, defer to black
E501

# allow line breaks before binary ops
W503

# allow line breaks after binary ops
W504

# allow whitespace before ':' (https://github.com/psf/black#slices)
E203

exclude =
.git
.venv*/
venv*/
target
__pycache__
*/build/lib/*
35 changes: 35 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This action requires that any PR targeting the main branch should touch at
# least one CHANGELOG file. If a CHANGELOG entry is not required, add the "Skip
# Changelog" label to disable this action.

name: changelog

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
branches:
- main

jobs:
changelog:
runs-on: ubuntu-latest
if: |
!contains(github.event.pull_request.labels.*.name, 'Skip Changelog')
steps:
- uses: actions/checkout@v2

- name: Check for CHANGELOG changes
run: |
# Only the latest commit of the feature branch is available
# automatically. To diff with the base branch, we need to
# fetch that too (and we only need its latest commit).
git fetch origin ${{ github.base_ref }} --depth=1
if [[ $(git diff --name-only FETCH_HEAD | grep CHANGELOG) ]]
then
echo "A CHANGELOG was modified. Looks good!"
else
echo "No CHANGELOG was modified."
echo "Please add a CHANGELOG entry, or add the \"Skip Changelog\" label if not required."
false
fi
115 changes: 88 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,95 @@
name: Publish Python 🐍 distributions 📦 to PyPI
name: Versioning

on:
push:
tags:
- '*'
branches:
- development

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
versioning:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install pypa/setuptools
run: >-
python -m
pip install wheel
- name: Extract tag name
id: tag
run: echo ::set-output name=TAG_NAME::$(echo $GITHUB_REF | cut -d / -f 3)
- name: Update version in setup.py
run: >-
sed -i "s/{{VERSION_PLACEHOLDER}}/${{ steps.tag.outputs.TAG_NAME }}/g" setup.py
- name: Build a binary wheel
run: >-
python setup.py sdist bdist_wheel
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_TOKEN }}
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
pip install hatch
- name: Bump version
run: |
hatch version patch
git push origin development
- name: Tag release
run: |
git tag $(hatch version)
git push origin --tags
# name: Publish Python 🐍 distributions 📦 to PyPI

# on:
# push:
# branches:
# - development
# jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ['3.9']

# steps:
# - uses: actions/checkout@v3
# - name: Install Poetry
# run: pipx install poetry
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# cache: 'poetry'
# - name: Install dependencies
# run: poetry install
# - name: Test with Pytest
# run: poetry run pytest
# - name: Lint with flake8
# run: poetry run flake8
# release:
# needs: build
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.9"]
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Install Poetry
# run: pipx install poetry
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}

# - name: Install dependencies
# run: poetry install
# - name: Prepare package for release
# env:
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config user.name github-actions
# git config user.email github-actions@github.com
# poetry run semantic-release publish
# - name: Publish to PyPI 📦
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}



Loading

0 comments on commit d87c71e

Please sign in to comment.