Skip to content

Commit

Permalink
Add Makefile, Update Readme (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
hakancelikdev committed Nov 25, 2022
1 parent 95a1356 commit ab15cdc
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 6 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
tags:
- "**"
jobs:
publish:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
Expand All @@ -17,7 +17,27 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
- run: python -m build
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true

publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/setup-python@v2.1.4
with:
python-version: "3.8"
architecture: "x64"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build
- run: python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[test]
python -m pip install .[tests]
- name: Generate coverage report
run: |
Expand Down
44 changes: 44 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
dev:
pip install -e .[tests]
pip install pre-commit

lint:
git add .
pre-commit run --all-files

test:
pytest tests -x -v --disable-warnings

clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -rf .cache
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf htmlcov
rm -rf *.egg-info
rm -f .coverage
rm -f .coverage.*
rm -rf .tox
rm -rf build

push:
git push origin head

amend:
git add .
git commit --amend --no-edit
git push origin head -f

stable:
git checkout main
git branch -D stable
git checkout -b stable
git push origin head -f
git checkout main

git:
git config --local user.email "hakancelikdev@gmail.com"
git config --local user.name "Hakan Celik"
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
to date.**

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/hakancelikdev/unexport/main.svg)](https://results.pre-commit.ci/latest/github/hakancelikdev/unexport/main)
[![test](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml)
[![Test](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml)
[![Build Docs](https://github.com/hakancelikdev/unexport/actions/workflows/docs.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/docs.yml)
[![Publish Package on Pypi](https://github.com/hakancelikdev/unexport/actions/workflows/pypi.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/pypi.yml)

[![Pypi](https://img.shields.io/pypi/v/unexport)](https://pypi.org/project/unexport/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unexport)
Expand Down
4 changes: 3 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
to date.**

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/hakancelikdev/unexport/main.svg)](https://results.pre-commit.ci/latest/github/hakancelikdev/unexport/main)
[![test](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml)
[![Test](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/tests.yml)
[![Build Docs](https://github.com/hakancelikdev/unexport/actions/workflows/docs.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/docs.yml)
[![Publish Package on Pypi](https://github.com/hakancelikdev/unexport/actions/workflows/pypi.yml/badge.svg)](https://github.com/hakancelikdev/unexport/actions/workflows/pypi.yml)

[![Pypi](https://img.shields.io/pypi/v/unexport)](https://pypi.org/project/unexport/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/unexport)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ docs =
mkdocs-markdownextradata-plugin==0.2.5
mkdocs-minify-plugin==0.5.0
mkdocs-git-revision-date-localized-plugin==1.0.1
test =
tests =
pytest==6.2.4
pytest-cov==2.12.1

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ isolated_build = true
[testenv]
install_command = python -m pip install {opts} {packages}
extras =
test
tests
commands =
python -m pytest -v --cov unexport {posargs}

Expand Down

0 comments on commit ab15cdc

Please sign in to comment.