From 5918e971122ebbe84adfa65b9dc11ead20a8eee2 Mon Sep 17 00:00:00 2001 From: MarleneKress79789 Date: Fri, 19 Apr 2024 14:38:11 +0200 Subject: [PATCH] removed setup.py, because newer poetry versions dont create it anymore --- .gitattributes | 1 - .github/workflows/check_setup_py.yaml | 40 ------------------------ doc/changes/changes_0.1.1.md | 1 + githooks/pre-commit | 1 - githooks/update_setup_py.sh | 45 --------------------------- setup.py | 43 ------------------------- 6 files changed, 1 insertion(+), 130 deletions(-) delete mode 100644 .github/workflows/check_setup_py.yaml delete mode 100755 githooks/update_setup_py.sh delete mode 100644 setup.py diff --git a/ .gitattributes b/ .gitattributes index 1eafcad..0b1ed86 100644 --- a/ .gitattributes +++ b/ .gitattributes @@ -1,2 +1 @@ -setup.py linguist-generated poetry.lock linguist-generated \ No newline at end of file diff --git a/.github/workflows/check_setup_py.yaml b/.github/workflows/check_setup_py.yaml deleted file mode 100644 index 3270ecf..0000000 --- a/.github/workflows/check_setup_py.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Check if setup.py is up to date - -on: - push: - # This way it only triggers on branch pushes, - # and ignores releases that push a tag. - tags-ignore: - - '**' - branches-ignore: - - github-pages/* - -jobs: - check_setup_py: - strategy: - fail-fast: false - matrix: - python-version: [3.8] - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - uses: abatilo/actions-poetry@v2 - with: - poetry-version: 1.8.0 - - name: Poetry install - run: poetry install - - name: Run packaging update - run: bash githooks/update_setup_py.sh - - name: Show changes on working copy - run: git status --porcelain=v1 -uno - - name: Show diff on working copy - run: git diff --cached; cat setup.py - - name: Check if setup.py changed - run: | - [ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ] - - name: Check if setup.py works - run: pip install . diff --git a/doc/changes/changes_0.1.1.md b/doc/changes/changes_0.1.1.md index b92f6af..eda678f 100644 --- a/doc/changes/changes_0.1.1.md +++ b/doc/changes/changes_0.1.1.md @@ -25,6 +25,7 @@ TBD - #16: Changed path-like parameters from String to Path - #34: Changed "push-enabled" parameter to Bool - #41: Updated importlib_resources and Poetry in GH workflows + - Removed setup.py, installation via wheel from Github or poetry env should be unaffected ## Security diff --git a/githooks/pre-commit b/githooks/pre-commit index 68b0019..907b599 100755 --- a/githooks/pre-commit +++ b/githooks/pre-commit @@ -7,5 +7,4 @@ REPO_DIR=$(git rev-parse --show-toplevel) GITHOOKS_PATH="$REPO_DIR/githooks" pushd "$REPO_DIR" bash "$GITHOOKS_PATH/prohibit_commit_to_main.sh" -bash "$GITHOOKS_PATH/update_setup_py.sh" popd diff --git a/githooks/update_setup_py.sh b/githooks/update_setup_py.sh deleted file mode 100755 index 58d8182..0000000 --- a/githooks/update_setup_py.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -set -o errexit -set -o nounset -set -o pipefail - -# define colors for use in output -green='\033[0;32m' -no_color='\033[0m' -grey='\033[0;90m' - -# Jump to the current project's root directory (the one containing -# .git/) -ROOT_DIR=$(git rev-parse --show-toplevel || echo) -NO_GIT=FALSE -if [ -z "$ROOT_DIR" ] -then - echo "Did not found git repository, using '$PWD' as ROOT_DIR" - NO_GIT=TRUE - ROOT_DIR=$PWD -fi - - -pushd "$ROOT_DIR" > /dev/null - -echo -e "Generate setup.py ${grey}(pre-commit hook)${no_color}" -if [ -d "dist" ] -then - rm -r "dist" -fi -poetry build > /dev/null -pushd dist > /dev/null -tar_file=$(ls *.tar.gz) -extracted_dir=${tar_file%.tar.gz} -tar -xf $tar_file -cp "$extracted_dir/setup.py" ../setup.py -rm -r "$extracted_dir" -popd > /dev/null - -if [ "$NO_GIT" == "FALSE" ] -then - echo -e "Add generated files ${grey}(pre-commit hook)${no_color}" - git add setup.py -fi - -popd > /dev/null diff --git a/setup.py b/setup.py deleted file mode 100644 index fd2a9df..0000000 --- a/setup.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -from setuptools import setup - -packages = \ -['exasol_sphinx_github_pages_generator'] - -package_data = \ -{'': ['*'], - 'exasol_sphinx_github_pages_generator': ['_static/*', - '_static/scripts/*', - '_static/styles/*', - 'templates/*']} - -install_requires = \ -['Jinja2>=3.0.3,<4.0.0', - 'Sphinx>=4.5,<5.0', - 'click>=8.1.3,<9.0.0', - 'furo>=2022.02.14.1,<2023.0.0.0', - 'importlib_resources>=5.4.0', - 'myst-parser>=0.17.0,<0.18.0'] - -entry_points = \ -{'console_scripts': ['sgpg = exasol_sphinx_github_pages_generator.cli:main']} - -setup_kwargs = { - 'name': 'exasol-sphinx-github-pages-generator', - 'version': '0.1.1', - 'description': 'Generates Sphinx GitHub pages for a given Git Repository', - 'long_description': 'Sphinx GitHub Pages Generator\n*****************************\n\n.. _docu_start:\n\nOverview\n========\n\nThis project provides a python library for accessing automatic generation of sphinx GitHub pages \nfor a given repository. It is intended for the use with a Continuous Integration solution.\nDeveloped using GitHub Actions.\nWe are using Sphinx for generating the documentation,\nbecause it is the default documentation tool for Python projects.\nSphinx supports reStructuredText with appropriate cross-document references.\nWe use the MyST-Parser to also integrate markdown files into the documentation.\n\nIn a Nutshell\n=============\n\nMotivation\n----------\n\nUsing Sphinx for building the documentation of a project in the CI is a bit different to the steps you can use during coding,\nbecause it also contains the preparations for publishing. At the moment, we publish\nthe documentation on Github Pages.\n\nTo publish it there, the HTML needs to be built from the documentation source and committed. It also needs to be ensured\nit adheres to the file structure expected by GitHub Pages.\nOur usual directory structure doesn\'t fit these requirements, so we decided to create\na new Git root commit and initially set github-pages/main branch to this commit.\nWe then add new commits to this branch to update existing or add new versions of the documentation.\n\nThis has the additional benefit, that we don\'t have automatic commits to the source branch.\nFor each branch or tag for which we build the documentation in the CI\nwe add a directory to the root directory of the github-pages/main branch.\n\nFor simplification of this process, we build the Sphinx_GitHub-Pages-Generator.\n\nPrerequisites\n-------------\n\n- Python 3.8+\n\nInstallation\n-------------\n..\n _This: todo fix installation description\n\nInstall the package from Github via `pip`::\n\n pip install -e git://github.com/exasol/sphinx-github-pages-generator.git@{tag name}#egg=exasol-sphinx-github-pages-generator\n\nDocumentation\n-------------\n\n`Documentation for the latest release `_ is hosted on the Github Pages of this project.\n\nFeatures\n========\n\n* Build html documentation files using Sphinx\n* Choose which remote branch to generate the documentation from\n* Choose whether to automatically push the generated and committed documentation or not.\n* Works with multiple packages in one repository.\n* Generates a index.html file containing links to all existing documentations on that branch.\n This file is generated using the "furo" theme.\n', - 'author': 'Marlene Kreß', - 'author_email': 'marlene.kress@exasol.com', - 'maintainer': 'None', - 'maintainer_email': 'None', - 'url': 'https://github.com/exasol/sphinx-github-pages-generator', - 'packages': packages, - 'package_data': package_data, - 'install_requires': install_requires, - 'entry_points': entry_points, - 'python_requires': '>=3.8,<4.0', -} - - -setup(**setup_kwargs)