Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Commit

Permalink
0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaals committed Mar 28, 2020
1 parent 5c80b63 commit e6ee106
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 90 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/push.yaml

This file was deleted.

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

on:
push:
tags:
- '*.*.*'

jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
python-version: '3.8'
steps:
- uses: actions/checkout@v2
- name: Get tag
id: tag
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
- name: Set up Python ${{ env.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ env.python-version }}
- name: Get Python version
id: python-version
run: |
echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Install Poetry
uses: dschep/install-poetry-action@v1.3
with:
create_virtualenvs: 'true'
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project true
- name: Get package version
id: package-version
run: echo ::set-output name=version::$(poetry version | grep -Po "\d+\.\d+\.\d+$")
- name: Check if tag matches package version
if: steps.tag.outputs.tag != steps.package-version.outputs.version
run: |
echo Tag: ${{ steps.tag.outputs.tag }}
echo Package version: ${{ steps.package-version.outputs.version }}
echo Tag and package version do not match
exit 1
- name: Cache Poetry virtualenv
uses: actions/cache@v1
id: cache
with:
path: .venv
key: poetry-venv-${{ runner.os }}-${{ steps.python-version.outputs.version }}
- name: Install/update package and dependencies
run: poetry install
- name: Create release ${{ steps.tag.outputs.tag }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.tag }}
release_name: ${{ steps.tag.outputs.tag }}
draft: 'false'
prerelease: 'false'
- name: Build and publish to PyPi
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
run: poetry publish --build
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.idea/
.vscode/
__pycache__/

poetry.lock
*.egg-info/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Nihaal Sangha
Copyright (c) 2019-2020 Nihaal Sangha

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 6 additions & 4 deletions pecho/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License
#
# Copyright (c) 2019 Nihaal Sangha
# Copyright (c) 2019-2020 Nihaal Sangha
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand All @@ -20,15 +20,17 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from importlib.metadata import version as _version

import colorama

colorama.init()

__all__ = ['echo']
__version__ = '0.1.0'
__version__ = _version('pecho')


def echo(*objects, sep=' ', end='', file=None, flush=True, newline=False, print_func=print):
def echo(*objects, sep=' ', end='', file=None, flush=True, newline=False, print_func=print, **print_kwargs):
if objects:
objects = ('\r' + str(objects[0]),) + objects[1:]

Expand All @@ -37,4 +39,4 @@ def echo(*objects, sep=' ', end='', file=None, flush=True, newline=False, print_
if newline:
end += '\n'

print_func(*objects, sep=sep, end=end, file=file, flush=flush)
print_func(*objects, sep=sep, end=end, file=file, flush=flush, **print_kwargs)
2 changes: 1 addition & 1 deletion pecho/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ __all__: List[str]
__version__: str

def echo(*objects: Any, sep: str = ' ', end: str = '', file: TextIO = sys.stdout, flush: bool = False,
newline: bool = False, print_func: Callable = print):
newline: bool = False, print_func: Callable = print, **print_kwargs: Any):
...
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[tool.poetry]
name = "pecho"
version = "0.2.0"
description = "Easy way to write things like status bars"
authors = ["Nihaal Sangha <18350092+OrangutanGaming@users.noreply.github.com>"]
license = "MIT"
include = ["LICENSE"]
readme = "README.md"
repository = "https://github.com/OrangutanGaming/pecho"

[tool.poetry.dependencies]
python = "^3.8"
colorama = "^0.4.3"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

55 changes: 0 additions & 55 deletions setup.py

This file was deleted.

0 comments on commit e6ee106

Please sign in to comment.