Merge branch 'kerl/pip' into 'master'

Packaging pour pip/pypi

See merge request klub-dev-ens/authens!16
This commit is contained in:
Ludovic Stephan 2020-07-28 00:11:23 +02:00
commit 263a30bff7
7 changed files with 95 additions and 4 deletions

5
.gitignore vendored
View file

@ -14,3 +14,8 @@ __pycache__
# Tests # Tests
.tox .tox
# Packaging
/build
/dist
*.egg-info

View file

@ -3,6 +3,7 @@ image: python
stages: stages:
- linters - linters
- tests - tests
- release
variables: variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/vendor/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/vendor/pip"
@ -11,6 +12,10 @@ cache:
paths: paths:
- vendor - vendor
# ---
# Linters
# ---
linters: linters:
stage: linters stage: linters
before_script: before_script:
@ -21,6 +26,10 @@ linters:
- isort --check --diff . - isort --check --diff .
- flake8 --exit-zero authens - flake8 --exit-zero authens
# ---
# Test suite
# ---
before_script: before_script:
- mkdir -p vendor/{apt,pip} - 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 - 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: script:
- tox -e py38-django22 - tox -e py38-django22
- tox -e py38-django30 - 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

21
LICENSE Normal file
View file

@ -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.

3
MANIFEST.in Normal file
View file

@ -0,0 +1,3 @@
include LICENSE
recursive-include authens/static *
recursive-include authens/templates *

View file

@ -1,2 +1,3 @@
python-cas==1.5.* Django>=2.2
python-ldap python-ldap>=3,<4
python-cas>=1.5,<2

36
setup.py Normal file
View file

@ -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"],
)

View file

@ -1,6 +1,4 @@
[tox] [tox]
# Temporaire en attendant de créer setup.py
skipsdist = True
envlist = envlist =
py{35,36,37,38}-django22, py{35,36,37,38}-django22,
py{36,37,38}-django30 py{36,37,38}-django30