Skip to content
Snippets Groups Projects
Commit 7f4f95f9 authored by Marek Chrastina's avatar Marek Chrastina
Browse files

Add documentation to CI

parent c956a787
No related branches found
No related tags found
1 merge request!1Add py script
Pipeline #8596 passed
......@@ -25,7 +25,7 @@ pylint:
- python setup.py egg_info
- pip install $(paste -d " " -s pipdeps.egg-info/requires.txt)
script:
- pylint $(find . -type f -name "*.py")
- pylint $(find . -type f -not -path "*/.eggs/*" -name "*.py")
build:
stage: build
......@@ -37,7 +37,16 @@ build:
before_script:
- export PYTHONIOENCODING=UTF-8
- export LC_CTYPE=en_US.UTF-8
- pip install mustache pystache
script:
- echo "output_engine = mustache(\"restructuredtext\")" >> .gitchangelog.rc
- gitchangelog >> HISTORY.txt
- cat HISTORY.txt
- echo "output_engine = mustache(\"markdown\")" >> .gitchangelog.rc
- echo >> README.md
- gitchangelog | sed -r '1,/^# Changelog$/s/^(# Changelog)$/#\1/' >> README.md
- python setup.py --version
- echo "version = '$(python setup.py --version)'" >> version.py
- python setup.py sdist
Install test:
......@@ -51,23 +60,24 @@ Install test:
versioncheck:
stage: check
image: it4innovations/docker-pypi:latest
before_script:
- pip install packaging
script:
- export IT4I_FACTORY_PREBUILD=1
- python setup.py --version
- export BUILD_VERSION="$(python setup.py --version)"
- >-
export PUBLISHED_VERSION="$(pip install pipdeps== 2>&1 | grep -oE "\(from versions: .*)" | sed "s/(from versions: //" | sed "s/)//" | tr ", " "\n" | tail -n1)"
# - export EGG_VERSION=$(grep -E "^Version:" pipdeps.egg-info/PKG-INFO | grep -Eo "[0-9.]+")
# - CMP_VERSION="$(cmp-version $EGG_VERSION $PUBLISHED_VERSION)"
# - if [ $CMP_VERSION -eq 1 ]; then true; else echo "Egg info is older/same version as module already available from public pypi repository. Please run python setup.py egg_info and commit changes"; false; fi
- CMP_VERSION="$(cmp-version $BUILD_VERSION $PUBLISHED_VERSION)"
- if [ $CMP_VERSION -eq 1 ]; then true; else echo 'Git tag is older/same version as module already available from public pypi repository. Please run git tag -a <version> -m "<version>"'; false; fi
#- CMP_VERSION="$(cmp-version $BUILD_VERSION $PUBLISHED_VERSION)"
#- if [ $CMP_VERSION -eq 1 ]; then true; else echo 'Git tag is older/same version as module already available from public pypi repository. Please run git tag -a <version> -m "<version>"'; false; fi
- >-
echo -e "import sys\nfrom packaging.version import Version, LegacyVersion\nver1=Version('$BUILD_VERSION')\nver2=Version('$PUBLISHED_VERSION')\nif ver1>ver2: sys.exit(0)\nif ver1<ver2: sys.exit(1)\nif ver1==ver2: sys.exit(2)" | python
- if [ $? -eq 0 ]; then true; else echo 'Git tag is older/same version as module already available from public pypi repository. Please run git tag -a <version> -m "<version>"'; false; fi
upload:
stage: deploy
image: it4innovations/docker-pypi:latest
script:
- twine upload -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" dist/pipdeps*tar.gz
# only:
# - master
only:
- master
when: manual
......@@ -338,8 +338,6 @@ def main():
arguments = arg_parse()
pyver = get_pyver()
pkglist = get_pip_list()
if 'pipdeps' in pkglist:
pkglist.remove('pipdeps')
jsonpipdeptree = get_jsonpipdeptree()
packages_data = collect_packages(pkglist, jsonpipdeptree, pyver=pyver)
for pkg, pkg_data in sorted(
......
......@@ -19,15 +19,12 @@ setup(
author_email='support@it4i.cz',
url='https://code.it4i.cz/sccs/pip-deps',
license='GPLv3+',
packages=find_packages(),
namespace_packages=['pipdeps'],
zip_safe=False,
version='0.0.dev1',
# version_format='{tag}',
version_format='{tag}',
long_description_markdown_filename='README.md',
setup_requires=['setuptools-markdown'],
# setup_requires=['setuptools-git-version', 'setuptools-markdown'],
setup_requires=['mustache', 'pystache', 'setuptools-git-version', 'setuptools-markdown'],
install_requires=[
'packaging',
'pipdeptree',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment