From bc5971e48623afc8072d2997a3247f44459a0947 Mon Sep 17 00:00:00 2001 From: AlexandreDoneux <94830560+AlexandreDoneux@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:00:37 +0100 Subject: [PATCH] [packaging] Use two pyproject.toml files (with and without use of docker compose) [packaging] Removing unique pyproject.toml --- pyproject.toml => base_package/pyproject.toml | 33 ++++---- docker_compose_package/pyproject.toml | 84 +++++++++++++++++++ setup.py | 29 ------- 3 files changed, 98 insertions(+), 48 deletions(-) rename pyproject.toml => base_package/pyproject.toml (66%) create mode 100644 docker_compose_package/pyproject.toml delete mode 100644 setup.py diff --git a/pyproject.toml b/base_package/pyproject.toml similarity index 66% rename from pyproject.toml rename to base_package/pyproject.toml index 38144380b..d6d799d85 100644 --- a/pyproject.toml +++ b/base_package/pyproject.toml @@ -45,7 +45,7 @@ dependencies = [ "zipstream==1.1.4", "argon2-cffi == 23.1.0", - # testing requirements and doc requirements -> needed here ? + # testing requirements and doc requirements "INGInious[doc]", ] @@ -69,21 +69,17 @@ doc = [ ] -#[project.scripts] # in windows scripts need a terminal. If launched from gui it will open one. To prevent this : use [project.gui-scripts] instead -# -## no way to add condition in TOML ? -## -> define scripts in setup.py so I can use os.environ.get("INGINIOUS_COMPOSE") to conditionnaly add scripts -# -#inginious-agent-docker = "inginious.agent.docker:main" -#inginious-agent-mcq = "inginious.agent.mcq:main" -#inginious-backend = "inginious.backend:main" -#inginious-webapp = "inginious.webapp:main" -#inginious-webdav = "inginious.webdav:main" -#inginious-install = "inginious.install:main" -#inginious-autotest = "inginious.autotest:main" -#inginious-synchronize = "utils.sync.inginious-synchronize:main" -#inginious-container-update = "utils.container_update.inginious-container-update:main" -#inginious-database-update = "utils.database_updater.inginious-database-update:main" +[project.scripts] # in windows scripts need a terminal. If launched from gui it will open one. To prevent this : use [project.gui-scripts] instead +inginious-agent-docker = "inginious.agent.docker:main" +inginious-agent-mcq = "inginious.agent.mcq:main" +inginious-backend = "inginious.backend:main" +inginious-webapp = "inginious.webapp:main" +inginious-webdav = "inginious.webdav:main" +inginious-install = "inginious.install:main" +inginious-autotest = "inginious.autotest:main" +inginious-synchronize = "utils.sync.inginious-synchronize:main" +inginious-container-update = "utils.container_update.inginious-container-update:main" +inginious-database-update = "utils.database_updater.inginious-database-update:main" [project.urls] @@ -93,10 +89,9 @@ Repository = "https://github.com/UCL-INGI/INGInious" Issues ="https://github.com/UCL-INGI/INGInious/issues" -# enables setuptools_scm, can be empty +# enables setuptools_scm [tool.setuptools_scm] # automatically find packages in the project -[tool.setuptools.packages.find] -# possibility to include, exclude define the folders containing packages, ... \ No newline at end of file +[tool.setuptools.packages.find] \ No newline at end of file diff --git a/docker_compose_package/pyproject.toml b/docker_compose_package/pyproject.toml new file mode 100644 index 000000000..eb6996aba --- /dev/null +++ b/docker_compose_package/pyproject.toml @@ -0,0 +1,84 @@ +[build-system] +requires = ["setuptools==69.1.0", "setuptools-scm==8.0.4"] +build-backend = "setuptools.build_meta" + + +[project] +name = "INGInious" +dynamic = ["version"] # check if works, need a _version.py file? (see scm github readme) +authors = [ + {name = "INGInious contributors", email = "inginious@info.ucl.ac.be"}, +] +description = "An intelligent grader that allows secured and automated testing of code made by students." +readme = "README.rst" +requires-python = ">=3.8" # needed ? -> could work with other versions +keywords = ["autograder", "programming", "training", "learning", "education", + "mooc", "autograding", "evaluation", "grading", "exercise", "interview", + "assessment", "lti", "learn-to-code", "programming-exercise", "e-assessment", + "technical-coding-interview", "coding-interviews", "inginious" ] +license = {text = "AGPL 3"} +classifiers = [ # add classifiers + "Programming Language :: Python :: 3", +] + +dependencies = [ + "docker==7.0.0", + "docutils==0.20.1", + "Flask==3.0.2", + "Flask-Mail==0.9.1", + "itsdangerous==2.1.2", + "Jinja2==3.1.3", + "lti==0.9.5", + "msgpack==1.0.7", + "natsort==8.4.0", + "psutil==5.9.8", + "pymongo==4.6.1", + "pytidylib==0.3.2", + "PyYAML==6.0.1", + "pyzmq==25.1.2", + "requests-oauthlib==1.3.1", + "sh==2.0.6", + "watchdog==4.0.0", + "Werkzeug==3.0.1", + "MarkupSafe==2.1.5", + "WsgiDAV==4.3.0", + "zipstream==1.1.4", + "argon2-cffi == 23.1.0", + + # testing requirements and doc requirements + "INGInious[doc]", +] + + +[project.optional-dependencies] +cgi = ["flup==1.0.3"] +ldap = ["ldap3==2.9.1"] +saml2 = ["python3-saml==1.16.0"] +uwsgi = ["uwsgi==2.0.24"] +test = [ + "pytest==8.0.0", + "coverage==7.4.1" +] +doc = [ + "ipython==8.21.0", + "sphinx==7.2.6", + "sphinx-autodoc-typehints==2.0.0", + "sphinx-rtd-theme==2.0.0", + "sphinx-tabs==3.4.5", + "INGInious[test]" +] + + +[project.urls] +Homepage = "https://inginious.org/" +Documentation = "https://docs.inginious.org" +Repository = "https://github.com/UCL-INGI/INGInious" +Issues ="https://github.com/UCL-INGI/INGInious/issues" + + +# enables setuptools_scm +[tool.setuptools_scm] + + +# automatically find packages in the project +[tool.setuptools.packages.find] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 053691c18..000000000 --- a/setup.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for -# more information about the licensing of this file. - -import sys -import os -from setuptools import setup, find_packages - - -scripts = [] if os.environ.get("INGINIOUS_COMPOSE") else [ - 'inginious-agent-docker', - 'inginious-agent-mcq', - 'inginious-backend', - 'inginious-webapp', - 'inginious-webdav', - 'inginious-install', - 'inginious-autotest', - 'utils/sync/inginious-synchronize', - 'utils/container_update/inginious-container-update', - 'utils/database_updater/inginious-database-update' -] - -# Setup -setup( - scripts=scripts, - test_suite='nose.collector', -)