Skip to content

Commit

Permalink
sort out pypi and move last bits of python-squ over
Browse files Browse the repository at this point in the history
  • Loading branch information
adonm committed Mar 26, 2024
1 parent 48fab6c commit 7ff8e33
Show file tree
Hide file tree
Showing 11 changed files with 798 additions and 27 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Below is how to install in a plain python 3.11+ environment

``` sh
https://github.com/wagov/nbdev-squ/releases/download/v1.3.2/nbdev_squ-1.3.2-py3-none-any.whl
pip install nbdev-squ
```

The installation can also be run in a notebook (we tend to use
Expand All @@ -18,7 +18,7 @@ should load the json secret *squconfig-`my_keyvault_tenantid`* from the
`my_kevault_name` keyvault.

``` python
%pip install https://github.com/wagov/nbdev-squ/releases/download/v1.3.2/nbdev_squ-1.3.2-py3-none-any.whl
%pip install nbdev-squ
import os; os.environ["SQU_CONFIG"] = "{{ my_keyvault_name }}/{{ my_keyvault_tenantid }}"

from nbdev_squ import api
Expand Down
10 changes: 0 additions & 10 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,5 @@
run(["npm", "run", "build"])
run(["nbdev_clean"])
run(["nbdev_export"])

config = configparser.ConfigParser()
config.read('settings.ini')
version = config.get("DEFAULT", "version")
git_url = config.get("DEFAULT", "git_url")
latest_download = f"{git_url}/releases/download/v{version}/nbdev_squ-{version}-py3-none-any.whl"
index_text = open("nbs/index.ipynb").read()
with open("nbs/index.ipynb", "w") as index_nb:
index_nb.write(re.sub(f"{git_url}.*?-any.whl", latest_download, index_text))

run(["nbdev_readme"])
run(["nbdev_docs"])
2 changes: 1 addition & 1 deletion nbdev_squ/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.3.2"
__version__ = "1.3.3"
8 changes: 7 additions & 1 deletion nbdev_squ/_modidx.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@
'nbdev_squ.core.azcli': ('core.html#azcli', 'nbdev_squ/core.py'),
'nbdev_squ.core.datalake_path': ('core.html#datalake_path', 'nbdev_squ/core.py'),
'nbdev_squ.core.load_config': ('core.html#load_config', 'nbdev_squ/core.py'),
'nbdev_squ.core.login': ('core.html#login', 'nbdev_squ/core.py')}}}
'nbdev_squ.core.login': ('core.html#login', 'nbdev_squ/core.py')},
'nbdev_squ.legacy': { 'nbdev_squ.legacy.adx_query': ('legacy.html#adx_query', 'nbdev_squ/legacy.py'),
'nbdev_squ.legacy.adxtable2df': ('legacy.html#adxtable2df', 'nbdev_squ/legacy.py'),
'nbdev_squ.legacy.export_jira_issues': ('legacy.html#export_jira_issues', 'nbdev_squ/legacy.py'),
'nbdev_squ.legacy.flatten': ('legacy.html#flatten', 'nbdev_squ/legacy.py'),
'nbdev_squ.legacy.sentinel_beautify_local': ( 'legacy.html#sentinel_beautify_local',
'nbdev_squ/legacy.py')}}}
7 changes: 3 additions & 4 deletions nbdev_squ/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'atlaskit_transformer', 'security_incidents', 'security_alerts']

# %% ../nbs/01_api.ipynb 3
import pandas, json, logging, time, requests, io, pkgutil
import pandas, json, logging, time, requests, io, pkgutil, httpx_cache
from .core import *
from diskcache import memoize_stampede
from importlib.metadata import version
Expand All @@ -15,6 +15,8 @@
from azure.identity import AzureCliCredential
from benedict import benedict
from functools import cached_property
from atlassian import Jira
from tenable.io import TenableIO

# %% ../nbs/01_api.ipynb 5
logger = logging.getLogger(__name__)
Expand All @@ -34,7 +36,6 @@ def runzero(self):
"""
Returns a runzero client
"""
import httpx_cache
return httpx_cache.Client(base_url="https://console.rumble.run/api/v1.0", headers={"Authorization": f"Bearer {self.config.runzero_apitoken}"})

@cached_property
Expand All @@ -50,15 +51,13 @@ def jira(self):
"""
Returns a jira client
"""
from atlassian import Jira
return Jira(url=self.config.jira_url, username=self.config.jira_username, password=self.config.jira_password)

@cached_property
def tio(self):
"""
Returns a TenableIO client
"""
from tenable.io import TenableIO
return TenableIO(self.config.tenable_access_key, self.config.tenable_secret_key)


Expand Down
Loading

0 comments on commit 7ff8e33

Please sign in to comment.