Skip to content

SDK Release v0.1.16 #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .circleci/config.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "tagged-release"

on:
push:
tags:
- "v*"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install pipenv
run: pip install pipenv

- name: Install dependencies
run: |
pipenv install --dev

- name: Build
run: |
pipenv run python -m build

- name: Install
run: |
pip install dist/sumologic_sdk*.whl

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
dist/sumologic_sdk*.whl
31 changes: 31 additions & 0 deletions .github/workflows/runtest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Run Security & Linting tests"
on: [workflow_dispatch, pull_request]

jobs:
run-test:
name: "Run Security & Linting Tests"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install pipenv and mypy
run: pip install pipenv mypy

- name: Install dependencies
run: |
pipenv install --dev

- name: Run Security Tests
continue-on-error: true
run: |
pipenv run bandit sumologic/*.py

- name: Run Linting Tests
run: |
pipenv run flake8 --max-line-length=120 sumologic/*.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ nosetests.xml
.project
.pydevproject
.idea/

.DS_Store
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
# CHANGELOG for sumologic-python-sdk
This project adheres to [Semantic Versioning](http://semver.org/). The CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)

## [Unreleased]
## [0.1.16]
### Fixed
- Fixed Retry logic and bug related to headers to make it compatible with newer python versions

## [0.1.15]
### Fixed
- Upgraded request dependency for CVE fixes

## [0.1.14]
### Added
- Added monitor apis
- Added retry logic

### Fixed
- fixed Flake 8 errors

## [0.1.13]
### Added
- Added script for tracing hierarchy


## [0.1.12]
### Added
- Added V2 report job apis
- Added get_file api for use with V2 report job
Expand Down
22 changes: 21 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,28 @@ Contributing to cookbook-elasticsearch
1. After reviewing commits for documentation, passing CI tests, and good descriptive commit messages, merge it with either "squash and merge" or "rebase and merge" do not use the
"merge pull request" as it does not do a fast forward first.

### Upgrading to new python versions

### Releasing
1. Update python version in `Pipfile`.
1. Run `pipenv update --python <new version ex 3.12>` will update the `Pipfile.lock` file.
1. Run `pyupgrade sumologic/sumologic.py` will upgrade the syntax.
1. Run `pipenv run bandit sumologic/sumologic.py` will find common security issues.
1. Run `pipenv run flake8 sumologic/sumologic.py` will find linting issues.

### Building and Releasing

1. Create/update the changelog entries and evaluate the type of release.
1. create a git release with something like hub, example: `hub release create vMajor.Minor.patch`
1. Run `pip install pipenv` to install pipenv
1. Run `pipenv install --dev` to install dev dependencies
1. Run `pipenv run python -m build`
1. Run `pipenv run python -m twine upload dist/*` to publish in pypi repository

### Testing
1. Generate the access keys by following the sumologic [docs](https://help.sumologic.com/docs/manage/security/access-keys/#from-the-preferences-page). The user should have `Manage Collectors` permissions.
1. export the below environment variables
` export SUMOLOGIC_ACCESS_ID=<your user's access id>
export SUMOLOGIC_ACCESS_KEY = <your user's access key>
`
1. Run the unit tests present in `test` folder
`python -m unittest`
5 changes: 3 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
include requirements.txt
include LICENSE
include VERSION
include README
include sumologic *.py
include README.md
recursive-include sumologic *.py
recursive-exclude scripts *
recursive-exclude test *

6 changes: 4 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ bandit = "*" # https://github.com/PyCQA/bandit
better_exceptions = "*"
black = "*"
pipenv = {path = ".", editable = true, extras = ["test"]}
flake8 = ">=3.3.0,<4"
flake8 = "*"
pre-commit = "*" # https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/
pytest = "*"
requests = "*"
twine = "*"
build = "*"

[packages]
requests = "*"

[requires]
python_version = "3.6"
python_version = "3.12"

[pipenv]
allow_prereleases = true
Loading
Loading