Skip to content

Commit

Permalink
Migrate to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
iakov-kaiumov committed Apr 23, 2024
1 parent 86272bd commit 8f92bf8
Show file tree
Hide file tree
Showing 9 changed files with 724 additions and 107 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: cd

on:
release:
types:
- published
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
publish_to_pypi:
name: publish to pypi on new release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: JRubics/[email protected]
name: Build and publish to PyPI
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
47 changes: 0 additions & 47 deletions .github/workflows/main.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: test

on:
push:
branches:
- master

jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.10'
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install project
run: poetry install --no-interaction
#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run tests
run: |
source .venv/bin/activate
cd gsheet_pandas
python -m unittest tests.py
2 changes: 1 addition & 1 deletion gsheet_pandas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .adapter.connection import DriveConnection, setup


__version__ = '0.2.6'
__version__ = '0.2.7'
__author__ = 'Iakov Kaiumov'
618 changes: 618 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions pypi-update.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
username = os.getenv('USERNAME')
password = os.getenv('PASSWORD')

os.system('python setup.py sdist')
os.system('python setup.py bdist_wheel --universal ')
os.system(f'twine upload --skip-existing dist/* -u {username} -p {password}')
os.system('poetry build')
os.system(f'poetry publish --username {username} --password {password}')
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[build-system]
requires = ["setuptools", "wheel", "poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "gsheet-pandas"
version = "0.2.7"
description = "Download and upload pandas dataframes to the Google sheets"
authors = [{name = "Iakov Kaiumov", email = "[email protected]"}]
readme = "README.md"
license = {file = "LICENSE"}

[tool.poetry.dependencies]
python = "^3.9"
google-api-python-client = "^2.101.0"
google-auth-httplib2 = "^0.1.1"
google-auth-oauthlib = "^1.1.0"
pandas = "^2.1.1"
python-dotenv = "^1.0.0"

[tool.poetry.dev-dependencies]
28 changes: 0 additions & 28 deletions requirements.txt

This file was deleted.

28 changes: 0 additions & 28 deletions setup.py

This file was deleted.

0 comments on commit 8f92bf8

Please sign in to comment.