Skip to content

Commit

Permalink
Merge pull request #5 from BastiTee/feature/0.0.8
Browse files Browse the repository at this point in the history
Release 0.0.8
  • Loading branch information
BastiTee authored May 4, 2022
2 parents b23660c + 44cf691 commit 02100a7
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 547 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ jobs:
name: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2

- name: Setup python
uses: actions/setup-python@v3
with:
python-version: "${{ matrix.python-version }}"
architecture: "x64"

- name: CI checks
run: |
python3 -m pip install wheel poetry
Expand Down
17 changes: 4 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ venv: clean
$(POETRY_CMD) install

shell:
@echo Initialize virtualenv and open a new shell using it
@echo Open a new shell using virtualenv
$(POETRY_CMD) shell

test:
@echo Run all tests in default virtualenv
@echo Run all tests suites
$(POETRY_CMD) run py.test tests

isort:
@echo Check for incorrectly sorted imports
$(POETRY_CMD) run isort --check-only $(PY_FILES)

isort-apply:
@echo Check for incorrectly sorted imports
@echo Check and correct incorrectly sorted imports
$(POETRY_CMD) run isort $(PY_FILES)

mypy:
Expand All @@ -63,7 +63,7 @@ lint:
$(POETRY_CMD) run flake8 $(PY_FILES)

build: test mypy isort black lint
@echo Run setup.py-based build process to package application
@echo Run build process to package application
$(POETRY_CMD) build

run:
Expand All @@ -79,12 +79,3 @@ publish:
$(POETRY_CMD) publish
git tag -a $(VERSION) -m "Version $(VERSION)"
git push --tags

fetch-latest-boilerplate:
@echo Fetch latest python3-boilerplate version from github
git remote add py3template git@github.com:BastiTee/python3-boilerplate.git \
||true
git pull py3template main --allow-unrelated-histories ||true
@echo ----------------------------------------------------
@echo Resolve all merge conflicts and commit your changes!
@echo ----------------------------------------------------
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
## Setup

- [Use this template.](https://github.com/BastiTee/python3-boilerplate/generate)
- Make sure that `python` and [`poetry`](https://python-poetry.org/) has been properly installed (Python 2 is not supported – :skull:). Usually a simple `python -m pip install poetry` is enough.
- On first checkout run `make` to initialize the project configuration and build everything.
- Refer to [the Makefile](Makefile) to learn about the various operations available. Most of them are just facades for `poetry`.
- To rename the project you can use [the provided script](__rename__.sh): `./__rename__.sh`.
- To rename the project you can use [the provided script](rename_template.sh): `./rename_template.sh`.

## Features

Expand Down Expand Up @@ -36,7 +37,7 @@

## Future ideas and todos

- Introduce Python 3.7 and Python 3.10 to test matrix
- Introduce Python 3.10 to test matrix
- Embed flake8 config into `pyproject.toml` once they support it ([see](https://github.com/PyCQA/flake8/issues/234))

## Licensing
Expand Down
15 changes: 3 additions & 12 deletions my_module/__main__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
# -*- coding: utf-8 -*-
"""Module init-file.
"""Module main-file.
A module's __name__ is set equal to '__main__' when read from standard input,
a script, or from an interactive prompt.
"""

import click

from my_module.utils import add_two_numbers


@click.command('my_module')
@click.option('--number-a', '-a', type=click.INT, default=2)
@click.option('--number-b', '-b', type=click.INT, default=2)
def main(number_a: int, number_b: int) -> None:
"""Enter main application."""
print('Executed from command line...')
print(f'{number_a} + {number_b} equals {add_two_numbers(number_a, number_b)}')
def main() -> None: # noqa: D103
print('Hello world!')


if __name__ == '__main__':
Expand Down
14 changes: 0 additions & 14 deletions my_module/utils.py

This file was deleted.

Loading

0 comments on commit 02100a7

Please sign in to comment.