-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
4 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Publish Python 📦 to PyPI and TestPyPI | ||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
release: | ||
types: | ||
- published | ||
jobs: | ||
build-n-publish: | ||
name: Build and publish Python 📦 to PyPI and TestPyPI | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: | | ||
pip install --upgrade pip | ||
pip install wheel | ||
python setup.py sdist bdist_wheel | ||
- name: Publish distribution 📦 to Test PyPI | ||
if: github.event_name == 'push' | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish distribution 📦 to PyPI if triggered by release | ||
if: github.event_name == 'release' | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
import os | ||
import json | ||
import os | ||
|
||
import yaml | ||
|
||
from . import parser # noqa | ||
from .errors import OpenmanException | ||
import parser | ||
from .schema_converter import SchemaConvertor | ||
from .schema_converter import SchemaConvertor # noqa | ||
|
||
|
||
def from_collection(postmanfile=None): | ||
if postmanfile is None: | ||
raise OpenmanException('Empty file is not allowed') | ||
raise OpenmanException("Empty file is not allowed") | ||
if not os.path.isfile(postmanfile): | ||
raise FileNotFoundError("Postman collection not found") | ||
with open(postmanfile, 'r') as f: | ||
with open(postmanfile, "r") as f: | ||
return json.load(f) | ||
|
||
|
||
def from_ignore(ignorefile=None): | ||
ignoreschema = {} | ||
if not ignorefile: | ||
return ignoreschema | ||
with open(ignorefile, 'r') as f: | ||
with open(ignorefile, "r") as f: | ||
try: | ||
ignoreschema = yaml.safe_load(f) | ||
except yaml.YAMLError as exc: | ||
except yaml.YAMLError: | ||
ignoreschema = json.load(f) | ||
return ignoreschema | ||
return ignoreschema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters