diff --git a/.gitignore b/.gitignore index 8351c11..42dbf44 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,8 @@ __pycache__ # Tests .tox + +# Packaging +/build +/dist +*.egg-info diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 073fdbd..a5a6ca8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ image: python stages: - linters - tests + - release variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/vendor/pip" @@ -11,6 +12,10 @@ cache: paths: - vendor +# --- +# Linters +# --- + linters: stage: linters before_script: @@ -21,6 +26,10 @@ linters: - isort --check --diff . - flake8 --exit-zero authens +# --- +# Test suite +# --- + before_script: - mkdir -p vendor/{apt,pip} - apt-get update -q && apt-get -o dir::cache::archives="vendor/apt" install -yqq python3-dev libldap2-dev libsasl2-dev @@ -52,3 +61,21 @@ python38: script: - tox -e py38-django22 - tox -e py38-django30 + +# --- +# Release artifacts +# --- + +build_wheels: + stage: release + image: python + only: + - tags + artifacts: + paths: + - dist/* + when: on_success + before_script: + - pip install --upgrade setuptools wheel + script: + - python setup.py sdist bdist_wheel diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e2ce68f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright 2020 Klub Dev ENS + +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 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..6fdff9a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include LICENSE +recursive-include authens/static * +recursive-include authens/templates * diff --git a/requirements.txt b/requirements.txt index d281cf0..7bf27e4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ -python-cas==1.5.* -python-ldap +Django>=2.2 +python-ldap>=3,<4 +python-cas>=1.5,<2 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..b3d00dc --- /dev/null +++ b/setup.py @@ -0,0 +1,36 @@ +import setuptools + +with open("README.md", "r") as file: + long_description = file.read() + + +setuptools.setup( + name="authens", + version="0.1b0", + author="Klub Dev ENS", + author_email="klub-dev@ens.fr", + description="CAS Authentication at the ENS", + long_description=long_description, + long_description_content_type="text/markdown", + url="https://git.eleves.ens.fr/klub-dev-ens/authens", + packages=setuptools.find_packages(), + classifiers=[ + "Environment :: Web Environment", + "Framework :: Django", + "Framework :: Django :: 2.2", + "Framework :: Django :: 3.0", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Internet :: WWW/HTTP :: Dynamic Content", + ], + python_requires=">=3.5", + install_requires=["Django>=2.2", "python-ldap>=3,<4", "python-cas>=1.5,<2"], +) diff --git a/tox.ini b/tox.ini index 86d1123..9a5c460 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,4 @@ [tox] -# Temporaire en attendant de créer setup.py -skipsdist = True envlist = py{35,36,37,38}-django22, py{36,37,38}-django30