Skip to content

Commit

Permalink
applies pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
namiyousef committed Oct 31, 2023
1 parent 570c60d commit 8e98fdb
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 17 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish_package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "pre-release"

on:
push:
branches:
- "main"

jobs:
pre-release:
name: "Pre Release"
runs-on: "ubuntu-latest"
permissions: write-all
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
LICENSE.txt
*.jar
publish:
runs-on: ubuntu-latest
permissions: read-all
needs: pre-release
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion in_n_out_clients/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.2.0"
__version__ = "0.3.0"

from in_n_out_clients.main import InNOutClient
21 changes: 15 additions & 6 deletions in_n_out_clients/google_calendar_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,23 @@ def create_events(
data_conflict_properties: list | None = None,
create_calendar_if_not_exist: bool = False, # how to specify HOW to create the calendar...!
) -> APIResponse:
"""Function to add events to a calendar
:param calendar_id: id of the calendar. See calendar resource for more information: https://developers.google.com/calendar/api/v3/reference/calendars
:param events: events to create. See for more information: https://developers.google.com/calendar/api/v3/reference/events/insert
:param on_asset_conflict: specify behaviour if calendar_id already exists, defaults to "ignore"
"""Function to add events to a calendar.
:param calendar_id: id of the calendar. See calendar resource
for more information:
https://developers.google.com/calendar/api/v3/reference/calendars
:param events: events to create. See for more information:
https://developers.google.com/calendar/api/v3/reference/events/insert
:param calendar_id: id of the calendar. See calendar resource for more information
: https: //developers.google.com/calendar/api/v3/reference/calendars
:param events: events to create. See for more information
: https: //developers.google.com/calendar/api/v3/reference/events/insert
:param on_asset_conflict: specify behaviour if calendar_id
already exists, defaults to "ignore"
:param on_data_conflict: specify behaviour if event already exists, defaults to "ignore"
:param data_conflict_properties: event properties to check for conflicts, defaults to None
:param create_calendar_if_not_exist: flag to create a calendar if it does not already exist, defaults to False
:param create_calendar_if_not_exist: flag to create a calendar
if it does not already exist, defaults to False
"""
try:
calendars = self._get_calendars()
Expand Down
26 changes: 16 additions & 10 deletions in_n_out_clients/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,19 @@ def get_function_parameters(method, exclude_self=True):


class InNOutClient:
"""Universal CLient to connect to different services
:param database_type: type of service to connect to
:param database_name: name of the service to connect to, if applicable
:param password: password of the service to connect to, if applicable
:param username: username of the service to connect to, if applicable
:param host: host of the service to connect to, if applicable
:param port: port of the service to connect to, if applicable
"""Universal CLient to connect to different services :param database_type:
type of service to connect to
:param database_name: name of the service to
connect to, if applicable
:param password: password of the service to
connect to, if applicable
:param username: username of the service to
connect to, if applicable
:param host: host of the service to connect to,
if applicable
:param port: port of the service to connect to, if
applicable.
"""

def __init__(
Expand Down Expand Up @@ -106,7 +112,7 @@ def __init__(

# should raise an error if fails
def _connect_to_client(self, database_type: str, connection_params: dict):
"""Function to connect to a client
"""Function to connect to a client.
:param database_type: type of service to connect to
:param connection_params: connection params to the service
Expand Down Expand Up @@ -139,8 +145,8 @@ def write(
on_asset_conflict: str = "append",
data_conflict_properties: list | None = None,
):
"""Generic function to write data to any resource. Note that the purpose
of this is solely to write data to an existing resource.
"""Generic function to write data to any resource. Note that the
purpose of this is solely to write data to an existing resource.
:param table_name: name of the table to write data to
:param data: the data to write, can be of any format
Expand Down

0 comments on commit 8e98fdb

Please sign in to comment.