From ac4a72f0db8aa1e40dc89b466761a62edded8687 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com>
Date: Fri, 24 Apr 2020 13:04:44 +0200
Subject: [PATCH] Initial project files

---
 .gitignore              | 138 ++++++++++++++++++++++++++++++++++++++++
 .pre-commit-config.yaml |  30 +++++++++
 LICENSE                 |   9 +++
 MANIFEST.in             |   8 +++
 Makefile                |  45 +++++++++++++
 README.md               |   4 +-
 pirates/__init__.py     |   0
 setup.cfg               |  15 +++++
 setup.py                |  49 ++++++++++++++
 tests/__init__.py       |   0
 10 files changed, 296 insertions(+), 2 deletions(-)
 create mode 100644 .gitignore
 create mode 100644 .pre-commit-config.yaml
 create mode 100644 LICENSE
 create mode 100644 MANIFEST.in
 create mode 100644 Makefile
 create mode 100644 pirates/__init__.py
 create mode 100644 setup.cfg
 create mode 100755 setup.py
 create mode 100644 tests/__init__.py

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a81c8ee
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,138 @@
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+#   For a library or package, you might want to ignore these files since the code is
+#   intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don't work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000..6f83ace
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,30 @@
+default_language_version:
+  python: python3.8
+
+repos:
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v2.5.0
+    hooks:
+      - id: trailing-whitespace
+        exclude: ^.*\.md$
+      - id: end-of-file-fixer
+      - id: debug-statements
+      - id: mixed-line-ending
+        args: [--fix=lf]
+      - id: detect-private-key
+      - id: check-merge-conflict
+
+  - repo: https://github.com/asottile/seed-isort-config
+    rev: v2.1.1
+    hooks:
+      - id: seed-isort-config
+
+  - repo: https://github.com/timothycrosley/isort
+    rev: 4.3.21
+    hooks:
+      - id: isort
+
+  - repo: https://github.com/psf/black
+    rev: 19.10b0
+    hooks:
+      - id: black
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..a0ae744
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) 2020, Jan Bednařík
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..cc59b47
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,8 @@
+graft pirates
+
+include LICENSE
+include README.md
+
+include .pre-commit-config.yaml
+
+global-exclude *.py[cod] __pycache__/*
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6474033
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,45 @@
+#!/usr/bin/make -f
+
+PYTHON = python
+VENV   = .venv
+
+help:
+	@echo "Setup:"
+	@echo "  venv           Setup virtual environment"
+	@echo "  install        Install dependencies to venv"
+	@echo "  install-hooks  Install pre-commit hooks"
+	@echo "  hooks          Run pre-commit hooks manually"
+	@echo ""
+	@echo "Database:"
+	@echo "  migrations     Generate migrations"
+	@echo "  migrate        Run migrations"
+	@echo ""
+	@echo "Testing:"
+	@echo "  test           Run tests"
+	@echo ""
+
+venv: .venv/bin/python
+.venv/bin/python:
+	${PYTHON} -m venv ${VENV}
+
+install: venv
+	${VENV}/bin/pip install -r requirements/base.txt -r requirements/dev.txt
+
+install-hooks:
+	pre-commit install --install-hooks
+
+hooks:
+	pre-commit run -a
+
+migrations: venv
+	${VENV}/bin/python manage.py makemigrations
+
+migrate: venv
+	${VENV}/bin/python manage.py migrate
+
+test:
+	tox
+
+.PHONY: help venv install install-hooks hooks migrations migrate test
+
+# EOF
diff --git a/README.md b/README.md
index 8d1c46c..bea3b29 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,3 @@
-# pirates
+# Pirates
 
-Django app na uživatele, týmy a skupiny, s napojením na LDAP a SSO.
\ No newline at end of file
+Django app na uživatele, týmy a skupiny, s napojením na LDAP a SSO.
diff --git a/pirates/__init__.py b/pirates/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..e9dbd03
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,15 @@
+[aliases]
+# alias `setup.py test` to `setup.py pytest`
+test = pytest
+
+[tool:pytest]
+python_files = test_*.py
+addopts = --ds=tests.settings
+
+[tool:isort]
+# config compatible with Black
+line_length = 88
+multi_line_output = 3
+default_sectiont = "THIRDPARTY"
+include_trailing_comma = true
+known_third_party =setuptools
diff --git a/setup.py b/setup.py
new file mode 100755
index 0000000..90f474d
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+
+import codecs
+import os
+
+from setuptools import find_packages, setup
+
+
+def read(fname):
+    file_path = os.path.join(os.path.dirname(__file__), fname)
+    return codecs.open(file_path, encoding="utf-8").read()
+
+
+setup(
+    name="pirates",
+    version="0.1.0",
+    license="MIT",
+    description="Django app for users, teamds and groups.",
+    long_description=read("README.md"),
+    long_description_content_type="text/markdown",
+    author="Jan Bednařík",
+    author_email="jan.bednarik@gmail.com",
+    url="https://gitlab.pirati.cz/to/pirates",
+    packages=find_packages("pirates"),
+    package_dir={"": "pirates"},
+    include_package_data=True,
+    classifiers=[
+        # complete classifier list: http://pypi.python.org/pypi?%3Aaction=list_classifiers
+        "Development Status :: 5 - Production/Stable",
+        "Intended Audience :: Developers",
+        "License :: OSI Approved :: MIT License",
+        "Operating System :: OS Independent",
+        "Programming Language :: Python",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.6",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: Implementation :: CPython",
+        "Topic :: Utilities",
+    ],
+    project_urls={
+        # "Documentation": "https://pirates.readthedocs.io/",
+        # "Changelog": "https://pirates.readthedocs.io/en/latest/changelog.html",
+        "Issue Tracker": "https://gitlab.pirati.cz/to/pirates/issues",
+    },
+    keywords=["django", "openid", "sso"],
+    python_requires=">=3.6",
+    install_requires=["mozilla-django-oidc>=1.2.3,<2"],
+)
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
-- 
GitLab