Selaa lähdekoodia

Updated boilerplate project

Nikola Kotur 3 vuotta sitten
vanhempi
commit
3747a95c87
13 muutettua tiedostoa jossa 83 lisäystä ja 193 poistoa
  1. 0 20
      .github/workflows/main.yml
  2. 0 7
      .vscode/extensions.json
  3. 0 15
      .vscode/launch.json
  4. 0 28
      .vscode/settings.json
  5. 73 0
      README-boilerplate.md
  6. 2 68
      README.md
  7. 0 7
      setup.cfg
  8. 7 9
      setup.py
  9. 0 1
      tests/__init__.py
  10. 0 37
      tests/test_utils.py
  11. 0 0
      vidd/__init__.py
  12. 1 1
      vidd/__main__.py
  13. 0 0
      vidd/utils.py

+ 0 - 20
.github/workflows/main.yml

@@ -1,20 +0,0 @@
-name: CI
-
-on:
-    push:
-        branches:
-            - master
-            - feature/*
-
-jobs:
-    build:
-        runs-on: ubuntu-latest
-
-        steps:
-            - uses: actions/checkout@v2
-            - uses: actions/setup-python@v1
-
-            - name: CI checks
-              run: |
-                  python3 -m pip install pipenv
-                  make

+ 0 - 7
.vscode/extensions.json

@@ -1,7 +0,0 @@
-{
-    "recommendations": [
-        "ms-python.python",
-        "ms-python.vscode-pylance"
-    ],
-    "unwantedRecommendations": []
-}

+ 0 - 15
.vscode/launch.json

@@ -1,15 +0,0 @@
-{
-    "version": "0.2.0",
-    "configurations": [
-        {
-            "name": "Run current file",
-            "type": "python",
-            "request": "launch",
-            "program": "${file}",
-            "env": {
-                "PYTHONPATH": "${workspaceRoot}"
-            },
-            "console": "integratedTerminal"
-        }
-    ]
-}

+ 0 - 28
.vscode/settings.json

@@ -1,28 +0,0 @@
-{
-    "python.pythonPath": ".venv/bin/python",
-    "python.analysis.extraPaths": [
-        "my_module",
-        "tests",
-        ".venv/bin/python"
-    ],
-    "editor.tabSize": 4,
-    "editor.insertSpaces": true,
-    "editor.wordWrapColumn": 80,
-    "editor.wordWrap": "wordWrapColumn",
-    "files.trimTrailingWhitespace": true,
-    "files.insertFinalNewline": true,
-    "files.trimFinalNewlines": true,
-    "editor.formatOnSave": true,
-    "python.linting.enabled": true,
-    "python.linting.lintOnSave": true,
-    "python.linting.pylintEnabled": false,
-    "python.linting.mypyEnabled": true,
-    "python.linting.flake8Enabled": true,
-    "python.linting.flake8Args": [
-        "--verbose"
-    ],
-    "python.testing.unittestEnabled": false,
-    "python.testing.nosetestsEnabled": false,
-    "python.testing.pytestEnabled": true,
-    "python.testing.pytestArgs": []
-}

+ 73 - 0
README-boilerplate.md

@@ -0,0 +1,73 @@
+# python3-boilerplate ![CI](https://github.com/BastiTee/python3-boilerplate/workflows/CI/badge.svg)
+
+> A best-practices template project for Python3 modules
+
+--------------------------------------------------------------------------------
+
+**Disclaimer**: If you see this on [pypi.org](https://pypi.org/project/python3-boilerplate/) please note that the project is only published here for testing purposes. Please visit [GitHub](https://github.com/BastiTee/python3-boilerplate) for the related template project.
+
+--------------------------------------------------------------------------------
+
+## Setup
+
+- Make sure that `python3` and `pip3` is installed and available on the path (on Ubuntu: `sudo apt-get install python3 python3-pip`)
+- On first checkout run `make venv` to initialize the project configuration
+- Refer to [the Makefile](Makefile) to learn about the various operations available
+- To rename the project you can use [the provided script](__rename__.sh)
+
+## Features
+
+- Basic project/module organization according to <https://packaging.python.org>
+- `Makefile` management script
+- [pipenv](https://github.com/pypa/pipenv) and virtual environments
+- [distutils](https://docs.python.org/3/library/distutils.html)-based installer script
+- Unit testing with [pytest](https://docs.pytest.org/en/latest/)
+- Multicore/-interpreter testing with [tox](https://tox.readthedocs.io/en/latest/)
+- Linting ([flake8](http://flake8.pycqa.org)) and code formatting ([autopep8](https://github.com/hhatto/autopep8)) support
+- [isort](https://pypi.org/project/isort/) support for automated import sorting
+- [mpyp](https://pypi.org/project/mypy/) support for type checking
+- Publishing to PyPi.org at <https://pypi.org/project/python3-boilerplate/>
+- [vscode](https://code.visualstudio.com/) editor configuration including plugin recommendations, debugging support, unit test discovery and on-save formatting
+- [Github actions](https://github.com/BastiTee/python3-boilerplate/actions) continuous integration
+
+## How to use in existing project
+
+To use it in an existing project you can merge the remote changes to your project.
+
+- Add remote to access the template project
+
+```shell
+git remote add py3template git@github.com:BastiTee/python3-boilerplate.git
+git pull py3template master --allow-unrelated-histories
+```
+
+- Solve all merge conflicts and commit. Most likely there will be a lot
+- Do whatever is necessary to remove the boilerplate you don't need, e.g.
+
+```shell
+rm -rf my_module tests/test_utils.py __rename__.sh
+```
+
+- Commit your changes and push to your project
+
+## Resources
+
+- <http://packaging.python.org/>
+- <https://packaging.python.org/en/latest/distributing.html>
+- <https://pypi.org/>
+- <https://github.com/pypa/sampleproject>
+- <https://www.python.org/dev/peps/>
+- <https://www.python.org/dev/peps/pep-0008/>
+- <https://www.kennethreitz.org/essays/why-you-should-use-vs-code-if-youre-a-python-developer>
+- <https://code.visualstudio.com/docs/python/python-tutorial>
+
+## Future ideas and todos
+
+- Optional static type hints ([PEP 484](https://www.python.org/dev/peps/pep-0484/)) with [mypy](https://github.com/python/mypy)
+- Make sure [tox](https://tox.readthedocs.io/) is working as expected for supported Python versions
+- Introduce [black](https://github.com/psf/black) in favour of other linters
+- Introduce [pyproject.toml](https://www.python.org/dev/peps/pep-0518/) along with bleeding edge build tools like [flit](https://flit.readthedocs.io/en/latest/rationale.html) or [poetry](https://python-poetry.org/)
+
+## Licensing
+
+This project is licensed under [Apache License 2.0](LICENSE.txt).

+ 2 - 68
README.md

@@ -1,72 +1,6 @@
-# python3-boilerplate ![CI](https://github.com/BastiTee/python3-boilerplate/workflows/CI/badge.svg)
+# Vidd
 
-> A best-practices template project for Python3 modules
-
---------------------------------------------------------------------------------
-
-**Disclaimer**: If you see this on [pypi.org](https://pypi.org/project/python3-boilerplate/) please note that the project is only published here for testing purposes. Please visit [GitHub](https://github.com/BastiTee/python3-boilerplate) for the related template project.
-
---------------------------------------------------------------------------------
-
-## Setup
-
-- Make sure that `python3` and `pip3` is installed and available on the path (on Ubuntu: `sudo apt-get install python3 python3-pip`)
-- On first checkout run `make venv` to initialize the project configuration
-- Refer to [the Makefile](Makefile) to learn about the various operations available
-- To rename the project you can use [the provided script](__rename__.sh)
-
-## Features
-
-- Basic project/module organization according to <https://packaging.python.org>
-- `Makefile` management script
-- [pipenv](https://github.com/pypa/pipenv) and virtual environments
-- [distutils](https://docs.python.org/3/library/distutils.html)-based installer script
-- Unit testing with [pytest](https://docs.pytest.org/en/latest/)
-- Multicore/-interpreter testing with [tox](https://tox.readthedocs.io/en/latest/)
-- Linting ([flake8](http://flake8.pycqa.org)) and code formatting ([autopep8](https://github.com/hhatto/autopep8)) support
-- [isort](https://pypi.org/project/isort/) support for automated import sorting
-- [mpyp](https://pypi.org/project/mypy/) support for type checking
-- Publishing to PyPi.org at <https://pypi.org/project/python3-boilerplate/>
-- [vscode](https://code.visualstudio.com/) editor configuration including plugin recommendations, debugging support, unit test discovery and on-save formatting
-- [Github actions](https://github.com/BastiTee/python3-boilerplate/actions) continuous integration
-
-## How to use in existing project
-
-To use it in an existing project you can merge the remote changes to your project.
-
-- Add remote to access the template project
-
-```shell
-git remote add py3template git@github.com:BastiTee/python3-boilerplate.git
-git pull py3template master --allow-unrelated-histories
-```
-
-- Solve all merge conflicts and commit. Most likely there will be a lot
-- Do whatever is necessary to remove the boilerplate you don't need, e.g.
-
-```shell
-rm -rf my_module tests/test_utils.py __rename__.sh
-```
-
-- Commit your changes and push to your project
-
-## Resources
-
-- <http://packaging.python.org/>
-- <https://packaging.python.org/en/latest/distributing.html>
-- <https://pypi.org/>
-- <https://github.com/pypa/sampleproject>
-- <https://www.python.org/dev/peps/>
-- <https://www.python.org/dev/peps/pep-0008/>
-- <https://www.kennethreitz.org/essays/why-you-should-use-vs-code-if-youre-a-python-developer>
-- <https://code.visualstudio.com/docs/python/python-tutorial>
-
-## Future ideas and todos
-
-- Optional static type hints ([PEP 484](https://www.python.org/dev/peps/pep-0484/)) with [mypy](https://github.com/python/mypy)
-- Make sure [tox](https://tox.readthedocs.io/) is working as expected for supported Python versions
-- Introduce [black](https://github.com/psf/black) in favour of other linters
-- Introduce [pyproject.toml](https://www.python.org/dev/peps/pep-0518/) along with bleeding edge build tools like [flit](https://flit.readthedocs.io/en/latest/rationale.html) or [poetry](https://python-poetry.org/)
+Dashcam video extractor and exporter.
 
 ## Licensing
 

+ 0 - 7
setup.cfg

@@ -39,10 +39,3 @@ warn_unused_ignores = true
 warn_unreachable = true
 # Error message config
 # pretty = true
-
-# -----------------------------------------------------------------------------
-# TEST CONFIGURATION
-# -----------------------------------------------------------------------------
-
-[tool:pytest]
-addopts = -p no:warnings

+ 7 - 9
setup.py

@@ -13,20 +13,18 @@ with open(path.join(path.abspath(path.dirname(__file__)), 'README.md'),
 
 setup(
     # Basic project information
-    name='python3-boilerplate',
-    version='0.0.5',
+    name='vidd',
+    version='0.0.1',
     # Authorship and online reference
-    author='Basti Tee',
-    author_email='basti.tee@posteo.de',
-    url='https://github.com/BastiTee/python3-boilerplate',
+    author='Nikola Kotur',
+    author_email='kotnick@gmail.com',
     # Detailled description
-    description='A best-practices template project for Python3 modules.',
+    description='Dashcam video extractor and exporter.',
     long_description=long_description,
     long_description_content_type='text/markdown',
-    keywords='sample setuptools development',
+    keywords='dashcam video',
     classifiers=[
         'Development Status :: 4 - Beta',
-        'Intended Audience :: Developers',
         'Natural Language :: English',
         'License :: OSI Approved :: Apache Software License',
         'Programming Language :: Python',
@@ -35,7 +33,7 @@ setup(
         'Programming Language :: Python :: 3.8'
     ],
     # Package configuration
-    packages=find_packages(exclude=('tests',)),
+    packages=find_packages(),
     include_package_data=True,
     python_requires='>= 3.6',
     install_requires=[],

+ 0 - 1
tests/__init__.py

@@ -1 +0,0 @@
-"""Test cases."""

+ 0 - 37
tests/test_utils.py

@@ -1,37 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Basic test suite.
-
-There are some 'noqa: F401' in this file to just test the isort import sorting
-along with the code formatter.
-"""
-
-import __future__  # noqa: F401
-
-import json  # noqa: F401
-from os import path  # noqa: F401
-from re import IGNORECASE, sub  # noqa: F401
-
-import pytest
-import requests  # noqa: F401
-
-import my_module  # noqa: F401
-from my_module.utils import add_two_numbers
-
-
-class TestUtils:  # noqa: D101
-
-    @pytest.mark.parametrize('number_left, number_right', [
-        (None, 1), (1, None), (None, None)
-    ])
-    def test_add_two_numbers_no_input(
-            self,
-            number_left: int,
-            number_right: int
-    ) -> None:
-        """Basic input validation."""
-        with pytest.raises(ValueError):
-            add_two_numbers(number_left, number_right)
-
-    def test_add_two_numbers_regular_input(self) -> None:
-        """Basic asserting test."""
-        assert add_two_numbers(2, 3) == 5

+ 0 - 0
my_module/__init__.py → vidd/__init__.py


+ 1 - 1
my_module/__main__.py → vidd/__main__.py

@@ -5,7 +5,7 @@ A module's __name__ is set equal to '__main__' when read from standard input,
 a script, or from an interactive prompt.
 """
 
-from my_module.utils import add_two_numbers
+from vidd.utils import add_two_numbers
 
 print('Executed from command line...')
 print(f'2 + 2 equals {add_two_numbers(2, 2)}')

+ 0 - 0
my_module/utils.py → vidd/utils.py