Skip to content

Commit

Permalink
Pypi publish (#22)
Browse files Browse the repository at this point in the history
* pypi-packaging: install python build
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Rename open feature python package
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Add code coverage to pipeline
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Update actions to match other sdks
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Update readme with relevant badges
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Update readme with relevant badges
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Fix merge pipeline to add all linting and tests
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Use python 3.10 in release step
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

* pypi-packaging: Use python 3.10 in requirements.txt
Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>

Signed-off-by: Andrew Helsby <ajhelsby@hotmail.com>
  • Loading branch information
ajhelsby authored Oct 13, 2022
1 parent 1727554 commit 7ef8667
Show file tree
Hide file tree
Showing 9 changed files with 137 additions and 47 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: "Lint PR"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 19 additions & 4 deletions .github/workflows/test.yml → .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Test
name: Merge

on:
push:
branches-ignore:
- 'main'
branches: [ master, main ]

jobs:
build:
Expand Down Expand Up @@ -37,6 +36,11 @@ jobs:
[ ! -d ".venv" ] && virtualenv .venv
. .venv/bin/activate
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python

- name: Install dependencies
run: pip install -r requirements-dev.txt

Expand All @@ -50,4 +54,15 @@ jobs:
run: isort .

- name: Test with pytest
run: pytest
run: coverage run --omit="*/test*" -m pytest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@e0fbd592d323cb2991fb586fdd260734fcb41fcb
with:
flags: unittests # optional
name: coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
71 changes: 71 additions & 0 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: PR

on:
pull_request:
branches: [ master, main ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
container: [ "python:3.8", "python:3.9", "python:3.10" ]
container:
image: ${{ matrix.container }}

steps:
- uses: actions/checkout@v2

- name: Cache virtualenvironment
uses: actions/cache@v2
with:
path: ~/.venv
key: ${{ hashFiles('requirements.txt', 'requirements-dev.txt') }}

- name: Upgrade pip
run: pip install --upgrade pip

- name: Create and activate Virtualenv
run: |
pip install virtualenv
[ ! -d ".venv" ] && virtualenv .venv
. .venv/bin/activate
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: python

- name: Install dependencies
run: pip install -r requirements-dev.txt

- name: Run black formatter check
run: black --check .

- name: Run flake8 formatter check
run: flake8 .

- name: Run isort formatter check
run: isort .

- name: Test with pytest
run: coverage run --omit="*/test*" -m pytest

- name: Upload coverage to Codecov
uses: codecov/codecov-action@e0fbd592d323cb2991fb586fdd260734fcb41fcb
with:
flags: unittests # optional
name: coverage # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
# separate terms of service, privacy policy, and support
# documentation.

name: Build and Deploy
name: Release

on:
push:
branches:
- 'main'
- main

permissions: # added using https://github.com/step-security/secure-workflows
contents: read

jobs:
build:
Expand Down Expand Up @@ -38,19 +41,7 @@ jobs:
. .venv/bin/activate
- name: Install dependencies
run: pip install -r requirements-dev.txt

- name: Run black formatter check
run: black --check .

- name: Run flake8 formatter check
run: flake8 .

- name: Run isort formatter check
run: isort .

- name: Test with pytest
run: pytest
run: pip install -r requirements.txt

- name: Install pypa/build
run: >-
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ requires = ["setuptools>=61.0.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "python_open_feature_sdk"
name = "openfeature_sdk"
version = "0.0.1"
description = "Standardizing Feature Flagging for Everyone"
readme = "README.md"
authors = [{ name = "Open Feature", email = "opensource@dynatrace.com" }]
readme = "readme.md"
authors = [{ name = "OpenFeature", email = "openfeature-core@groups.io" }]
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: Apache Software License",
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Open Feature SDK for Python
[![PyPI version](https://badge.fury.io/py/openfeature-sdk.svg)](https://badge.fury.io/py/openfeature-sdk)
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![Specification](https://img.shields.io/static/v1?label=Specification&message=v0.3.0&color=red)](https://github.com/open-feature/spec/tree/v0.3.0)
[![on-merge](https://github.com/open-feature/python-sdk/actions/workflows/merge.yml/badge.svg)](https://github.com/open-feature/python-sdk/actions/workflows/merge.yml)
[![codecov](https://codecov.io/gh/open-feature/python-sdk/branch/main/graph/badge.svg?token=FQ1I444HB3)](https://codecov.io/gh/open-feature/python-sdk)

This is the Python implementation of [OpenFeature](https://openfeature.dev), a vendor-agnostic abstraction library for evaluating feature flags.

Expand Down
3 changes: 2 additions & 1 deletion requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ black
pip-tools
pre-commit
flake8
pytest-mock
pytest-mock
coverage
28 changes: 4 additions & 24 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ astroid==2.11.5
# via pylint
attrs==21.4.0
# via pytest
autopep8==1.6.0
# via -r requirements-dev.in
black==22.3.0
# via -r requirements-dev.in
certifi==2021.10.8
# via requests
cfgv==3.3.1
# via pre-commit
charset-normalizer==2.0.12
# via requests
click==8.1.3
# via
# black
# pip-tools
coverage==6.5.0
# via -r requirements-dev.in
dill==0.3.4
# via pylint
distlib==0.3.4
Expand All @@ -32,8 +28,6 @@ flake8==4.0.1
# via -r requirements-dev.in
identify==2.5.0
# via pre-commit
idna==3.3
# via requests
iniconfig==1.1.1
# via pytest
isort==5.10.1
Expand All @@ -54,8 +48,6 @@ pathspec==0.9.0
# via black
pep517==0.12.0
# via pip-tools
pep8==1.7.1
# via -r requirements-dev.in
pip-tools==6.6.0
# via -r requirements-dev.in
platformdirs==2.5.2
Expand All @@ -70,9 +62,7 @@ pre-commit==2.19.0
py==1.11.0
# via pytest
pycodestyle==2.8.0
# via
# autopep8
# flake8
# via flake8
pyflakes==2.4.0
# via flake8
pylint==2.13.8
Expand All @@ -87,16 +77,10 @@ pytest-mock==3.7.0
# via -r requirements-dev.in
pyyaml==6.0
# via pre-commit
requests==2.27.1
# via responses
responses==0.20.0
# via -r requirements-dev.in
six==1.16.0
# via virtualenv
toml==0.10.2
# via
# autopep8
# pre-commit
# via pre-commit
tomli==2.0.1
# via
# black
Expand All @@ -108,10 +92,6 @@ typing-extensions==4.2.0
# astroid
# black
# pylint
urllib3==1.26.9
# via
# requests
# responses
virtualenv==20.14.1
# via pre-commit
wheel==0.37.1
Expand Down
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile requirements.in
#

0 comments on commit 7ef8667

Please sign in to comment.