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: ...@@ -25,7 +25,7 @@ pylint:
- python setup.py egg_info - python setup.py egg_info
- pip install $(paste -d " " -s pipdeps.egg-info/requires.txt) - pip install $(paste -d " " -s pipdeps.egg-info/requires.txt)
script: script:
- pylint $(find . -type f -name "*.py") - pylint $(find . -type f -not -path "*/.eggs/*" -name "*.py")
build: build:
stage: build stage: build
...@@ -37,7 +37,16 @@ build: ...@@ -37,7 +37,16 @@ build:
before_script: before_script:
- export PYTHONIOENCODING=UTF-8 - export PYTHONIOENCODING=UTF-8
- export LC_CTYPE=en_US.UTF-8 - export LC_CTYPE=en_US.UTF-8
- pip install mustache pystache
script: 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 - python setup.py sdist
Install test: Install test:
...@@ -51,23 +60,24 @@ Install test: ...@@ -51,23 +60,24 @@ Install test:
versioncheck: versioncheck:
stage: check stage: check
image: it4innovations/docker-pypi:latest image: it4innovations/docker-pypi:latest
before_script:
- pip install packaging
script: script:
- export IT4I_FACTORY_PREBUILD=1
- python setup.py --version - python setup.py --version
- export BUILD_VERSION="$(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 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 $BUILD_VERSION $PUBLISHED_VERSION)"
# - CMP_VERSION="$(cmp-version $EGG_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
# - 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)" 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 [ $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 - 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: upload:
stage: deploy stage: deploy
image: it4innovations/docker-pypi:latest image: it4innovations/docker-pypi:latest
script: script:
- twine upload -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" dist/pipdeps*tar.gz - twine upload -u "$PYPI_USERNAME" -p "$PYPI_PASSWORD" dist/pipdeps*tar.gz
# only: only:
# - master - master
when: manual when: manual
...@@ -338,8 +338,6 @@ def main(): ...@@ -338,8 +338,6 @@ def main():
arguments = arg_parse() arguments = arg_parse()
pyver = get_pyver() pyver = get_pyver()
pkglist = get_pip_list() pkglist = get_pip_list()
if 'pipdeps' in pkglist:
pkglist.remove('pipdeps')
jsonpipdeptree = get_jsonpipdeptree() jsonpipdeptree = get_jsonpipdeptree()
packages_data = collect_packages(pkglist, jsonpipdeptree, pyver=pyver) packages_data = collect_packages(pkglist, jsonpipdeptree, pyver=pyver)
for pkg, pkg_data in sorted( for pkg, pkg_data in sorted(
......
...@@ -19,15 +19,12 @@ setup( ...@@ -19,15 +19,12 @@ setup(
author_email='support@it4i.cz', author_email='support@it4i.cz',
url='https://code.it4i.cz/sccs/pip-deps', url='https://code.it4i.cz/sccs/pip-deps',
license='GPLv3+', license='GPLv3+',
packages=find_packages(), packages=find_packages(),
namespace_packages=['pipdeps'], namespace_packages=['pipdeps'],
zip_safe=False, zip_safe=False,
version='0.0.dev1', version_format='{tag}',
# version_format='{tag}',
long_description_markdown_filename='README.md', long_description_markdown_filename='README.md',
setup_requires=['setuptools-markdown'], setup_requires=['mustache', 'pystache', 'setuptools-git-version', 'setuptools-markdown'],
# setup_requires=['setuptools-git-version', 'setuptools-markdown'],
install_requires=[ install_requires=[
'packaging', 'packaging',
'pipdeptree', 'pipdeptree',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment