Skip to content

Commit

Permalink
Publish Fixes for PyPI (#7)
Browse files Browse the repository at this point in the history
* Test new release publish

* Test new release publish 2

* Test new release publish 3

* Test new release publish 4

* Test new release publish 5

* Test new release publish 6

* Test new release publish 7

* Test new release publish 8

* Test new release publish 8

* Test new release publish 9

* Test new release publish 10

* Test new release publish 11

* Test new release publish 12

* Test new release publish 12

* Test new release publish 14

* Test new release publish 15

* Fix Release Issues on PyPI
  • Loading branch information
genzgd authored May 30, 2022
1 parent 7b08016 commit 440ad99
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/on_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@ name: 'Publish Release'
on:
release:
types: [created]
push:
branches:
- 'release_test'

jobs:
set_version:
name: Set Version
runs-on: ubuntu-latest
outputs:
rv: ${{ steps.parse_version.outputs.rv }}
env:
CC_VERSION: ${{ ( startsWith(github.ref_name, 'v') && github.ref_name ) }}
steps:
- id: parse_version
run: echo "::set-output name=rv::${CC_VERSION/v/}"

build_wheels:
name: Build Wheel
name: Build Wheels
needs: set_version
strategy:
matrix:
python:
Expand All @@ -28,6 +37,12 @@ jobs:
python-version: ${{ matrix.python }}
- name: Install build dependencies
run: pip install setuptools wheel
- name: Update release version (Windows)
if: ${{ runner.os == 'Windows' }}
run: sed -i "s/developer_only/${{ needs.set_version.outputs.rv }}/" setup.py
- name: Update release version (Mac)
if: ${{ runner.os == 'macOS' }}
run: sed -i "" "s/developer_only/${{ needs.set_version.outputs.rv }}/" setup.py
- name: Build Wheel
run: python3 setup.py bdist_wheel
- name: Upload Artifact
Expand All @@ -37,13 +52,14 @@ jobs:
path: dist/*

publish:
needs: build_wheels
needs: [set_version, build_wheels]
name: Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build source distribution
run: |
sed -i "s/developer_only/${{ needs.set_version.outputs.rv }}/" setup.py
rm -rf dist artifacts
python setup.py sdist
- name: Retrieve wheels
Expand Down
2 changes: 1 addition & 1 deletion clickhouse_connect/driver/httpclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _raw_request(self, data=None, method='POST', params: Optional[Dict] = None,
logger.error(err_str)
if response.content:
logger.error(str(response.content))
err_str = f':\n {str(response.content)[0:240]}'
err_str = f':{err_str}\n {str(response.content)[0:240]}'
raise DatabaseError(err_str)

def ping(self):
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ def run_setup(try_c: bool = True):
with open(os.path.join(project_dir, 'README.md'), encoding='utf-8') as read_me:
long_desc = read_me.read()

version = os.environ.get('GITHUB_REF_NAME')
if version:
version = version.replace('v', '')
else:
version = 'develop'
version = 'developer_only'

setup(
name='clickhouse-connect',
Expand Down

0 comments on commit 440ad99

Please sign in to comment.