Nikola Kotur 3 år sedan
förälder
incheckning
773989f398
10 ändrade filer med 0 tillägg och 279 borttagningar
  1. 0 11
      .editorconfig
  2. 0 100
      Makefile
  3. 0 26
      Pipfile
  4. 0 28
      __rename__.sh
  5. 0 0
      run.py
  6. 0 41
      setup.cfg
  7. 0 42
      setup.py
  8. 0 6
      vidd/__init__.py
  9. 0 11
      vidd/__main__.py
  10. 0 14
      vidd/utils.py

+ 0 - 11
.editorconfig

@@ -1,11 +0,0 @@
-root = true
-
-[*]
-indent_style = space
-indent_size = 4
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-[Makefile]
-indent_style = tab

+ 0 - 100
Makefile

@@ -1,100 +0,0 @@
-# Required executables
-ifeq (, $(shell which python3))
- $(error "No python3 on PATH.")
-endif
-ifeq (, $(shell which pipenv))
- $(error "No pipenv on PATH.")
-endif
-
-# Suppress warning if pipenv is started inside .venv
-export PIPENV_VERBOSITY = 1
-# Use relative .venv folder instead of home-folder based
-export PIPENV_VENV_IN_PROJECT = 1
-# Ignore existing venvs
-export PIPENV_IGNORE_VIRTUALENVS = 1
-# Make sure we are running with an explicit encoding
-export LC_ALL = C
-export LANG = C.UTF-8
-# Set configuration folder to venv
-export PYPE_CONFIG_FOLDER = $(shell pwd)/.venv/.pype-cli
-# Process variables
-VERSION = $(shell python3 setup.py --version)
-PY_FILES := setup.py my_module tests
-
-all: clean venv build
-
-venv: clean
-	@echo Initialize virtualenv, i.e., install required packages etc.
-	pipenv --three install --dev
-
-shell:
-	@echo Initialize virtualenv and open a new shell using it
-	pipenv shell
-
-clean:
-	@echo Clean project base
-	find . -type d \
-	-name ".venv" -o \
-	-name ".tox" -o \
-	-name ".ropeproject" -o \
-	-name ".mypy_cache" -o \
-	-name ".pytest_cache" -o \
-	-name "__pycache__" -o \
-	-iname "*.egg-info" -o \
-	-name "build" -o \
-	-name "dist" \
-	|xargs rm -rfv
-
-	find . -type f \
-	-name "pyproject.toml" -o \
-	-name "Pipfile.lock" \
-	|xargs rm -rfv
-
-
-test:
-	@echo Run all tests in default virtualenv
-	pipenv run py.test tests
-
-testall:
-	@echo Run all tests against all virtualenvs defined in tox.ini
-	pipenv run tox -c setup.cfg tests
-
-isort:
-	@echo Check for incorrectly sorted imports
-	pipenv run isort --check-only $(PY_FILES)
-
-isort-apply:
-	@echo Check for incorrectly sorted imports
-	pipenv run isort $(PY_FILES)
-
-mypy:
-	@echo Run static code checks against source code base
-	pipenv run mypy my_module
-	pipenv run mypy tests
-
-lint:
-	@echo Run code formatting checks against source code base
-	pipenv run flake8 my_module tests
-
-build: test mypy isort lint
-	@echo Run setup.py-based build process to package application
-	pipenv run python setup.py bdist_wheel
-
-publish: all
-	@echo Release to pypi.org and create git tag
-	pipenv run twine upload dist/*
-	git tag -a $(VERSION) -m "Version $(VERSION)"
-	git push --tags
-
-run:
-	@echo Execute my_module directly
-	pipenv run python -m my_module
-
-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 master --allow-unrelated-histories ||true
-	@echo ----------------------------------------------------
-	@echo Resolve all merge conflicts and commit your changes!
-	@echo ----------------------------------------------------

+ 0 - 26
Pipfile

@@ -1,26 +0,0 @@
-[[source]]
-name = "pypi"
-url = "https://pypi.org/simple"
-verify_ssl = true
-
-[dev-packages]
-autopep8 = "*" # Code formatter
-flake8 = "*" # Base-linter module
-flake8-quotes = "*" # flake8-extension to lint bad quoting
-flake8-docstrings = "*" # flake8-ext for strict docstring linting
-flake8-builtins = "*" # flake8-ext to check python builtins used as vars etc.
-flake8-blind-except = "*" # flake8-ext to catch blind exception catches
-flake8-use-fstring = "*" # flake8-ext to enforce f-strings
-flake8-isort = "*" # flake8-ext to show isort issues
-pep8-naming = "*" # flake8-ext to enforce pep8 naming conventions
-isort = "*" # Automated import sorting
-pytest = "*" # Python base-testing library
-tox = "*" # Automated and standardized testing in Python
-rope = "*" # Refactoring library
-twine = "*" # Interoperability with pypi.org
-mypy = "*" # Optional static type checker
-typing_extensions = "*" # Typing extensions for mypy
-my_module = {path = ".", editable = true}
-
-[packages]
-requests = "*"

+ 0 - 28
__rename__.sh

@@ -1,28 +0,0 @@
-#!/bin/bash
-cd "$( cd "$( dirname "$0" )"; pwd )"
-
-show_help() {
-    cat << EOF
-Rename 'my_module' to your preferred project name.
-
-Usage: $( basename $0 ) <NEW_NAME>
-
-Arguments:
-
-    NEW_NAME       New project name.
-
-EOF
-}
-
-if [ -z "$1" ]; then show_help; exit 1; fi
-
-make clean
-rm -rf "$1"
-mv -v my_module "$1"
-find . -type f -exec grep -l my_module {} + |\
-grep -v -e $( basename $0 ) -e ".git" |while read file
-do
-    echo "- RENAME $file"
-    sed -i.rename-bak "s/my_module/$1/g" $file
-done
-find . -type f -iname "*.rename-bak" -exec rm -f {} \;

+ 0 - 0
run.py


+ 0 - 41
setup.cfg

@@ -1,41 +0,0 @@
-# -----------------------------------------------------------------------------
-# BUILDING WHEELS
-# -----------------------------------------------------------------------------
-
-[metadata]
-# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file
-license_files =
-    LICENSE.txt
-    README.md
-
-[bdist_wheel]
-# https://packaging.python.org/guides/distributing-packages-using-setuptools/#wheels
-universal=0
-
-# -----------------------------------------------------------------------------
-# FORMATTING AND LINTING
-# -----------------------------------------------------------------------------
-
-[flake8]
-# Q003 Change outer quotes to avoid escaping inner quotes
-# W503 line break before binary operator (preferred way)
-ignore = Q003,W503
-# flake8-use-fstring
-percent-greedy = 0
-format-greedy = 2
-
-[mypy]
-# Untyped definitions and calls
-# Disallows defining functions without type annotations or with
-# incomplete type annotations.
-disallow_untyped_defs = true
-# Type-checks the interior of functions without type annotations
-check_untyped_defs = true
-# Import discovery
-follow_imports = normal
-ignore_missing_imports = True
-# Warning configuration
-warn_unused_ignores = true
-warn_unreachable = true
-# Error message config
-# pretty = true

+ 0 - 42
setup.py

@@ -1,42 +0,0 @@
-#!/usr/bin/env python3
-# -*- coding: utf-8 -*-
-"""Setup process."""
-
-from io import open
-from os import path
-
-from setuptools import find_packages, setup
-
-with open(path.join(path.abspath(path.dirname(__file__)), 'README.md'),
-          encoding='utf-8') as f:
-    long_description = f.read()
-
-setup(
-    # Basic project information
-    name='vidd',
-    version='0.0.1',
-    # Authorship and online reference
-    author='Nikola Kotur',
-    author_email='kotnick@gmail.com',
-    # Detailled description
-    description='Dashcam video extractor and exporter.',
-    long_description=long_description,
-    long_description_content_type='text/markdown',
-    keywords='dashcam video',
-    classifiers=[
-        'Development Status :: 4 - Beta',
-        'Natural Language :: English',
-        'License :: OSI Approved :: Apache Software License',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 3.6',
-        'Programming Language :: Python :: 3.7',
-        'Programming Language :: Python :: 3.8'
-    ],
-    # Package configuration
-    packages=find_packages(),
-    include_package_data=True,
-    python_requires='>= 3.6',
-    install_requires=[],
-    # Licensing and copyright
-    license='Apache 2.0'
-)

+ 0 - 6
vidd/__init__.py

@@ -1,6 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Module init-file.
-
-The __init__.py files are required to make Python treat directories
-containing the file as packages.
-"""

+ 0 - 11
vidd/__main__.py

@@ -1,11 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Module init-file.
-
-A module's __name__ is set equal to '__main__' when read from standard input,
-a script, or from an interactive prompt.
-"""
-
-from vidd.utils import add_two_numbers
-
-print('Executed from command line...')
-print(f'2 + 2 equals {add_two_numbers(2, 2)}')

+ 0 - 14
vidd/utils.py

@@ -1,14 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Utility functions."""
-
-
-def add_two_numbers(
-    number_left: int = None,
-    number_right: int = None,
-) -> int:
-    """Add two numbers."""
-    if not number_left:
-        raise ValueError('Input number_left must be set.')
-    if not number_right:
-        raise ValueError('Input number_right must be set.')
-    return number_left + number_right