Skip to content

Commit

Permalink
feat(poetry): refactor to use poetry instead of pipenv and GH actions… (
Browse files Browse the repository at this point in the history
#94)

* feat(poetry): refactor to use poetry instead of pipenv and GH actions instead of Travis

* fix(ci): only run on push to master or PRs

* feat(ci): do pypi test push on PRs

* fix(ci): pass secrets in

* fix(ci): pass secrets explicitly

* chore(deps): less restrictive

* chore(deps): flexible deps

* feat(ci): update to latest PyPI support

* Update pypi.yaml
  • Loading branch information
Avantol13 authored Jan 19, 2024
1 parent be8631d commit d0f6de9
Show file tree
Hide file tree
Showing 25 changed files with 1,145 additions and 900 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
# run on pushed commits to master and on new commits on pull requests
push:
branches:
- master
pull_request:
types: [opened, synchronize]

jobs:
Security:
name: Security Pipeline
uses: uc-cdis/.github/.github/workflows/securitypipeline.yaml@master
with:
python-poetry: 'false'
secrets: inherit # pragma: allowlist secret
UnitTest:
name: Python Unit Test
uses: uc-cdis/.github/.github/workflows/python_unit_test.yaml@master
with:
python-version: '3.9'
18 changes: 18 additions & 0 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PyPI
on:
push:
branches:
- main
- master
tags:
- '*'
jobs:
PyPIPoetryPublish:
name: PyPI Poetry Publish
uses: uc-cdis/.github/.github/workflows/python_package_index_publish.yaml@master
with:
PYTHON_VERSION: '3.9'
DO_TEST_PUBLISH_FIRST: true
secrets:
PYPI_TEST_API_TOKEN: ${{ secrets.PYPI_TEST_API_TOKEN }}
PYPI_PROD_API_TOKEN: ${{ secrets.PYPI_PROD_API_TOKEN }}
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

18 changes: 0 additions & 18 deletions Pipfile

This file was deleted.

721 changes: 0 additions & 721 deletions Pipfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion docs/create_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import getpass
from io import open

PROJECT_NAME = "cirrus"
PROJECT_NAME = "gen3cirrus"
DOCUMENTATION_DIR = os.path.dirname(os.path.realpath(__file__))
SOURCE_CODE_DIR = os.path.abspath(DOCUMENTATION_DIR + "/../")

Expand Down
14 changes: 7 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# cirrus documentation build configuration file, created by
# gen3cirrus documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 4 12:06:39 2018.
#
# This file is execfile()d with the current directory set to its
Expand Down Expand Up @@ -55,7 +55,7 @@
master_doc = "index"

# General information about the project.
project = "cirrus"
project = "gen3cirrus"
copyright = "2018, avantol"
author = "avantol"

Expand Down Expand Up @@ -145,15 +145,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "cirrus.tex", "cirrus Documentation", "avantol", "manual")
(master_doc, "gen3cirrus.tex", "gen3cirrus Documentation", "avantol", "manual")
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "cirrus", "cirrus Documentation", [author], 1)]
man_pages = [(master_doc, "gen3cirrus", "gen3cirrus Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -164,10 +164,10 @@
texinfo_documents = [
(
master_doc,
"cirrus",
"cirrus Documentation",
"gen3cirrus",
"gen3cirrus Documentation",
author,
"cirrus",
"gen3cirrus",
"One line description of project.",
"Miscellaneous",
)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion cirrus/backoff.py → gen3cirrus/backoff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json
import sys

from cirrus.errors import CirrusError
from gen3cirrus.errors import CirrusError

logger = get_logger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion cirrus/config.py → gen3cirrus/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
cirrus Configuration
gen3cirrus Configuration
- Contains the necessary information to manage a google project, including
some info about it and credentials. Usually the credentials supplied
Expand Down
2 changes: 1 addition & 1 deletion cirrus/core.py → gen3cirrus/core.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
cirrus - Cloud API Wrapper Layer exposing easier Cloud Management
gen3cirrus - Cloud API Wrapper Layer exposing easier Cloud Management
Current Capabilities:
- Manage Google resources, policies, and access (specific Google APIs
Expand Down
2 changes: 1 addition & 1 deletion cirrus/errors.py → gen3cirrus/errors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class CirrusError(Exception):
def __init__(self, message="There was an error within the cirrus library.", *args):
def __init__(self, message="There was an error within the gen3cirrus library.", *args):
super(CirrusError, self).__init__(message)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from cirrus.errors import CirrusError
from gen3cirrus.errors import CirrusError


class GoogleNamingError(CirrusError):
Expand All @@ -20,7 +20,7 @@ def __init__(
"This action requires an authed session. Please use "
"Python's `with <Class> as <name>` syntax for a context manager "
"that automatically enters and exits authorized sessions using "
"default credentials. See cirrus's README for setup instructions."
"default credentials. See gen3cirrus's README for setup instructions."
)


Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@
from requests.exceptions import HTTPError as requestsHttpError
from urllib.parse import quote as urlquote

from cirrus.backoff import BACKOFF_SETTINGS
from cirrus.config import config
from cirrus.core import CloudManager
from cirrus.errors import CirrusError, CirrusUserError, CirrusNotFound
from cirrus.google_cloud.errors import (
from gen3cirrus.backoff import BACKOFF_SETTINGS
from gen3cirrus.config import config
from gen3cirrus.core import CloudManager
from gen3cirrus.errors import CirrusError, CirrusUserError, CirrusNotFound
from gen3cirrus.google_cloud.errors import (
GoogleAuthError,
GoogleAPIError,
GoogleNamingError,
)
from cirrus.google_cloud.iam import (
from gen3cirrus.google_cloud.iam import (
GooglePolicy,
GooglePolicyBinding,
GooglePolicyMember,
GooglePolicyRole,
get_iam_service_account_email,
)
from cirrus.google_cloud.services import GoogleAdminService, GoogleService
from cirrus.google_cloud.utils import (
from gen3cirrus.google_cloud.services import GoogleAdminService, GoogleService
from gen3cirrus.google_cloud.utils import (
get_valid_service_account_id_for_user,
get_service_account_cred_from_key_response,
get_proxy_group_name_for_user,
Expand Down Expand Up @@ -515,7 +515,7 @@ def give_group_access_to_bucket(self, group_email, bucket_name, access=None):
bucket_name (str): Bucket to provide access to
Raises:
cirrus.google_cloud.errors.CirrusNotFound: No bucket found with given name
gen3cirrus.google_cloud.errors.CirrusNotFound: No bucket found with given name
"""
access = access or ["read"]
try:
Expand All @@ -542,7 +542,7 @@ def give_group_access_to_bucket(self, group_email, bucket_name, access=None):
else:
raise CirrusUserError(
"Unable to grant {access_level} access to {group_email} "
"on bucket {bucket_name}. cirrus "
"on bucket {bucket_name}. gen3cirrus "
"does not support the access level {access_level}.".format(
access_level=access_level,
group_email=group_email,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from googleapiclient.discovery import build
import backoff

from cirrus.config import config
from cirrus.google_cloud.manager import BACKOFF_SETTINGS
from gen3cirrus.config import config
from gen3cirrus.google_cloud.manager import BACKOFF_SETTINGS


class GoogleService(object):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from google.oauth2 import service_account
from cdislogging import get_logger

from cirrus.config import config
from cirrus.google_cloud.errors import GoogleNamingError
from gen3cirrus.config import config
from gen3cirrus.google_cloud.errors import GoogleNamingError

GOOGLE_SERVICE_ACCOUNT_REGEX = "[a-z][a-z\d\-]*[a-z\d]"
logger = get_logger(__name__, log_level="info")
Expand Down
Loading

0 comments on commit d0f6de9

Please sign in to comment.