diff --git a/modules/account/.flake8 b/.flake8 similarity index 100% rename from modules/account/.flake8 rename to .flake8 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000..0a7a524775 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,30 @@ +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == "trigger" + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ + +stages: + - preparation + - execution + +prepare-job: + stage: preparation + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci + script: + - python .gitlab-scripts/generate-ci.py gitlab-generated-ci.yml + artifacts: + paths: + - gitlab-generated-ci.yml + +trigger-job: + stage: execution + trigger: + forward: + pipeline_variables: true + strategy: depend + include: + - artifact: gitlab-generated-ci.yml + job: prepare-job diff --git a/sao/.bower_allow_root.sh b/.gitlab-scripts/bower_allow_root.sh similarity index 100% rename from sao/.bower_allow_root.sh rename to .gitlab-scripts/bower_allow_root.sh diff --git a/.gitlab-scripts/generate-ci.py b/.gitlab-scripts/generate-ci.py new file mode 100755 index 0000000000..2517adf285 --- /dev/null +++ b/.gitlab-scripts/generate-ci.py @@ -0,0 +1,169 @@ +#!/bin/env python +import glob +import os +import subprocess +import sys +from itertools import chain +from string import Template + +BASE_DIR = os.path.dirname(__file__) +TEMPLATE_DOC = Template(""" +check-doc-${name}: + extends: .check-doc + variables: + PACKAGE: ${package} + +trigger-doc-build-${name}: + extends: .trigger-doc-build + variables: + PACKAGE: ${package} + +""") + +TEMPLATE = Template(""" +test-${name}: + extends: .test-tox + variables: + PACKAGE: ${package} + ${stage} + ${when} + +""") + +TEMPLATE_IMAGE = Template(""" +test-${name}: + extends: .test-tox + image: $${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/${package}-test:$${PYTHON_VERSION} + variables: + PACKAGE: ${package} + ${stage} + ${when} + +""") # noqa: E501 + +TEMPLATE_DB = Template(""" +test-${name}-sqlite: + extends: .test-sqlite + variables: + PACKAGE: ${package} + ${stage} + ${when} + +test-${name}-postgresql: + extends: .test-postgresql + variables: + PACKAGE: ${package} + ${stage} + ${when} + +""") + +TEMPLATE_GIS = Template(""" +test-${name}-postgis: + extends: .test-postgis + variables: + PACKAGE: ${package} + ${stage} + ${when} + +""") + +TEMPLATE_NPM_IMAGE = Template(""" +test-${name}: + extends: .test-npm + image: $${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/${package}-test + variables: + PACKAGE: ${package} + ${stage} + ${when} + +""") + +STAGE_MANUAL = "stage: manual" +WHEN_MANUAL = """ + allow_failure: true + rules: + - when: manual +""" +NO_DB = {'proteus'} +CUSTOM_IMAGE = {'tryton'} +CUSTOM_NPM_IMAGE = {'sao'} +GIS = {'trytond-gis'} + + +def main(filename): + if filename == '-': + render(sys.stdout) + else: + with open(filename, 'w') as file: + render(file) + + +def render(file): + file.write(open(os.path.join(BASE_DIR, 'gitlab-ci.yml'), 'r').read()) + packages = list(all_packages()) + modified = set(modified_packages(packages)) + for package in packages: + mapping = { + 'name': package.replace('/', '-'), + 'package': package, + 'stage': STAGE_MANUAL if package not in modified else '', + 'when': WHEN_MANUAL if package not in modified else '', + } + if os.path.exists(os.path.join(package, 'doc')): + file.write(TEMPLATE_DOC.substitute(mapping)) + if package in NO_DB: + file.write(TEMPLATE.substitute(mapping)) + elif package in CUSTOM_IMAGE: + file.write(TEMPLATE_IMAGE.substitute(mapping)) + elif package in CUSTOM_NPM_IMAGE: + file.write(TEMPLATE_NPM_IMAGE.substitute(mapping)) + elif package in GIS: + file.write(TEMPLATE_GIS.substitute(mapping)) + else: + file.write(TEMPLATE_DB.substitute(mapping)) + + +def all_packages(): + root_dir = os.path.dirname(BASE_DIR) + for filename in chain( + glob.glob('**/setup.py', recursive=True, root_dir=root_dir), + glob.glob('**/package.json', recursive=True, root_dir=root_dir)): + yield os.path.dirname(filename) + + +def modified_packages(packages): + env = os.environ.copy() + env['HGPLAIN'] = '1' + if env.get('CI_COMMIT_TAG'): + tagged = env['CI_COMMIT_TAG'].split('-')[0] + for package in packages: + if tagged in package: + yield package + else: + if not subprocess.run( + ['hg', 'topic', '--current'], + env=env, stdout=subprocess.DEVNULL).returncode: + cmd = ['hg', 'status', '--rev', 's0', '--no-status'] + else: + cmd = ['hg', 'status', '--change', '.', '--no-status'] + proc = subprocess.run(cmd, env=env, stdout=subprocess.PIPE, text=True) + proc.check_returncode() + modified_files = proc.stdout.splitlines() + + modified = set() + for filename in modified_files: + parts = filename.split(os.sep) + modified.add(parts[0]) + modified.add(os.sep.join(parts[:2])) + for package in packages: + if package in modified: + yield package + + +if __name__ == '__main__': + try: + filename = sys.argv[1] + except IndexError: + filename = '-' + main(filename) diff --git a/.gitlab-scripts/generate-doc.sh b/.gitlab-scripts/generate-doc.sh new file mode 100755 index 0000000000..a9a2062d20 --- /dev/null +++ b/.gitlab-scripts/generate-doc.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -eu + +OUTPUTDIR=`realpath "${1}"` +mkdir -p "${OUTPUTDIR}" + +find . -path '*/doc/conf.py' | while read path; do + path=`dirname "${path}"` + path=`dirname "${path}"` + package=`basename "${path}"` + package=$(echo ${package} | sed "s/_/-/g") + if [ "${package}" = "trytond" ]; then + package="server" + elif [ "${package}" = "tryton" ]; then + package="client-desktop" + elif [ "${package}" = "proteus" ]; then + package="client-library" + elif [ "${package}" = "trytond-gis" ]; then + package="backend-gis" + else + package="modules-${package}" + fi + (cd "${path}" && python -m sphinx -T -E -b html doc "${OUTPUTDIR}/${package}") +done diff --git a/.gitlab-scripts/generate-packages.sh b/.gitlab-scripts/generate-packages.sh new file mode 100755 index 0000000000..2bda53316b --- /dev/null +++ b/.gitlab-scripts/generate-packages.sh @@ -0,0 +1,9 @@ +#!/bin/sh +set -eu + +PACKAGES=`realpath "${1}"` +mkdir -p "${PACKAGES}" + +find . -name setup.py | while read path; do + (cd "`dirname ${path}`" && python setup.py sdist && cp dist/* "${PACKAGES}") +done diff --git a/.gitlab-scripts/gitlab-ci.yml b/.gitlab-scripts/gitlab-ci.yml new file mode 100644 index 0000000000..85f5f61687 --- /dev/null +++ b/.gitlab-scripts/gitlab-ci.yml @@ -0,0 +1,169 @@ +stages: + - preparation + - check + - test + - build + - manual + +packages: + stage: preparation + rules: + - when: always + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci + variables: + DOC_BASE_URL: ${CI_PROJECT_DIR}/docs + script: + - .gitlab-scripts/generate-packages.sh packages + artifacts: + paths: + - packages/ + expire_in: 1 week + +documentation: + stage: preparation + rules: + - when: always + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/sphinxdoc/sphinx + script: + - .gitlab-scripts/generate-doc.sh docs + artifacts: + paths: + - docs/ + expire_in: 1 week + +.check: + stage: check + rules: + - if: $CI_MERGE_REQUEST_ID != null + when: always + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci + +.check-doc: + extends: .check + needs: + - documentation + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/sphinxdoc/sphinx + variables: + DOC_BASE_URL: ${CI_PROJECT_DIR}/docs + DOC_DIR: doc + script: + - cd "${PACKAGE}" + - python -m sphinx -T -E -W -n -b html ${DOC_DIR} _build/html + - python -m sphinx -T -E -W -n -b linkcheck ${DOC_DIR} _build + rules: + - changes: + - ${PACKAGE}/${DOC_DIR}/**/* + - ${PACKAGE}/tryton.cfg + - ${PACKAGE}/CHANGELOG + +check-doc-readthedocs: + extends: .check-doc + variables: + PACKAGE: readthedocs + DOC_DIR: . + rules: + - changes: + - ${PACKAGE}/**/* + +check-flake8: + extends: .check + script: + - hg diff --rev s0 | flake8 --diff + +check-dist: + stage: check + needs: + - packages + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci + script: + - twine check packages/* + +.test: + stage: test + rules: + - when: always + +.test-tox: + extends: .test + needs: + - packages + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:${PYTHON_VERSION} + variables: + CFLAGS: -O0 + PIP_FIND_LINKS: file://${CI_PROJECT_DIR}/packages/ + before_script: + - pip install tox + script: + - tox -e "py${PYTHON_VERSION/./}" -c "${PACKAGE}" + parallel: + matrix: + - PYTHON_VERSION: ["3.6", "3.7", "3.8", "3.9"] + +.test-db: + extends: .test-tox + variables: + DB_CACHE: /tmp/cache + script: + - tox -e "py${PYTHON_VERSION/./}-${DATABASE}" -c "${PACKAGE}" + +.test-sqlite: + extends: .test-db + variables: + DATABASE: sqlite + +.test-postgresql: + extends: .test-db + variables: + DATABASE: postgresql + POSTGRESQL_URI: postgresql://postgres@postgresql:5432/ + POSTGRES_HOST_AUTH_METHOD: trust + services: + - name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/postgres + alias: postgresql + command: ["-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + +.test-postgis: + extends: .test-db + variables: + DATABASE: postgis + POSTGIS_URI: postgis://postgres@postgis:5432/ + POSTGRES_HOST_AUTH_METHOD: trust + script: + - tox -e "py${PYTHON_VERSION/./}" -c "${PACKAGE}" + services: + - name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/postgis/postgis + alias: postgis + command: ["-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"] + +.test-npm: + extends: .test + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node + before_script: + - sh .gitlab-scripts/bower_allow_root.sh + script: + - cd "${PACKAGE}" + - npm -s install --unsafe-perm --legacy-peer-deps + - npm test + +.trigger-doc-build: + stage: build + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/tryton/ci + script: + - .gitlab-scripts/trigger-readthedocs.py -c "${RTD_CONFIG}" -p "${PACKAGE}" -b "${CI_COMMIT_BRANCH#branch/}" + rules: + - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ + changes: + - ${PACKAGE}/doc/**/* + - ${PACKAGE}/tryton.cfg + - ${PACKAGE}/CHANGELOG + allow_failure: true + +trigger-doc-build-readthedocs: + extends: .trigger-doc-build + variables: + PACKAGE: readthedocs + rules: + - if: $CI_COMMIT_BRANCH =~ /^branch\/.*/ + changes: + - ${PACKAGE}/**/* + allow_failure: true diff --git a/.gitlab-scripts/trigger-readthedocs.py b/.gitlab-scripts/trigger-readthedocs.py new file mode 100755 index 0000000000..b6c66ffcb4 --- /dev/null +++ b/.gitlab-scripts/trigger-readthedocs.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python +# +# Requires $RTD_CONFIG to point to a file providing the webhook data for each +# package. The file is in Python cfg file format. +# Each section defines on package. Example:: +# +# [modules/party] +# url: https://readthedocs.org/api/v2/webhook/modules-party/12345/ +# token: 93afe1ce2d1107597f69774009964990c0643dad + +import configparser +import sys +from argparse import ArgumentParser +from urllib import request +from urllib.parse import urlencode + +parser = ArgumentParser() +parser.add_argument('--config', '-c', required=True) +parser.add_argument('--package', '-p', required=True) +parser.add_argument('--branches', '-b', nargs='*') +args = parser.parse_args() + +cfg = configparser.ConfigParser() +cfg.read(args.config) + +url = cfg.get(args.package, 'url') +token = cfg.get(args.package, 'token') +if not url: + sys.exit(f"Missing url for {args.package!r}") +elif not token: + sys.exit(f"Missing token for {args.package!r}") + +data = [ + ('token', token), + *(('branches', branch) for branch in args.branches), + ] + +req = request.Request( + url, + data=urlencode(data).encode(), + headers={ + 'User-Agent': 'python-urllib/%s' % request.__version__, + }) +with request.urlopen(req) as resp: + print(resp.read()) diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000000..0f6ca8b98e --- /dev/null +++ b/.hgignore @@ -0,0 +1,12 @@ +syntax: glob +*.py[cdo] +*.egg-info +dist/ +build/ +node_modules/ +bower_components/ +.tox/ +requirements.txt +requirements-dev.txt +.hgignore-modules +include:.hgignore-modules diff --git a/.hooks/link_modules b/.hooks/link_modules new file mode 100755 index 0000000000..2f3f806202 --- /dev/null +++ b/.hooks/link_modules @@ -0,0 +1,30 @@ +#!/usr/bin/env python +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import glob +import io +import os + +root = os.path.dirname(os.path.dirname(__file__)) +source = os.path.join(root, 'modules') +destination = os.path.join(root, 'trytond', 'trytond', 'modules') + +modules = set() +for filename in glob.glob('modules/*/setup.py', root_dir=root): + modules.add(os.path.basename(os.path.dirname(filename))) + +for module in modules: + path = os.path.join(destination, module) + if not os.path.exists(path): + os.symlink( + os.path.relpath(os.path.join(source, module), destination), path) + +for module in os.listdir(destination): + path = os.path.join(destination, module) + if os.path.islink(path) and module not in modules: + os.unlink(path) + +with io.open(os.path.join(root, '.hgignore-modules'), 'w') as fp: + for module in modules: + fp.write(os.path.join('trytond', 'modules', module) + '\n') diff --git a/.hooks/update_requirements b/.hooks/update_requirements new file mode 100755 index 0000000000..b197414e77 --- /dev/null +++ b/.hooks/update_requirements @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import io +import os +import subprocess +from multiprocessing.dummy import Pool + +root = os.path.dirname(os.path.dirname(__file__)) +module_path = os.path.join(root, 'modules') + +dependencies = set() +development_dependencies = set() + +FNULL = open(os.devnull, 'w') + + +def add_dependencies(package, path): + egg_info_name = '%s.egg-info' % package + egg_info = os.path.join(path, egg_info_name) + if (not os.path.isdir(egg_info) + or (os.path.getmtime(os.path.join(path, 'setup.py')) + > os.path.getmtime(os.path.join(egg_info, 'requires.txt'))) + or (os.path.exists(os.path.join(path, 'tryton.cfg')) + and os.path.getmtime(os.path.join(path, 'tryton.cfg')) + > os.path.getmtime(os.path.join(egg_info, 'requires.txt')))): + subprocess.call( + ['./setup.py', 'egg_info'], + cwd=path, + stdout=FNULL, + stderr=FNULL) + with io.open(os.path.join(egg_info, 'requires.txt')) as f: + development = False + for dependency in f.readlines(): + dependency = dependency.strip('\n') + # Do not include trytond requirements as we have its source code + if (not dependency + or dependency.startswith('trytond') + or dependency.startswith('proteus')): + continue + # Always include optional dependencies as development + if dependency[0].startswith('['): + development = True + continue + # Remove version numbers + for char in ['>', '<', '=']: + dependency = dependency.split(char)[0] + if development: + development_dependencies.add(dependency) + else: + dependencies.add(dependency) + + +pool = Pool() +pool.apply_async(add_dependencies, + ('trytond', os.path.join(root, 'trytond'))) +pool.apply_async(add_dependencies, + ('tryton', os.path.join(root, 'tryton'))) +pool.apply_async(add_dependencies, + ('proteus', os.path.join(root, 'proteus'))) +pool.apply_async(add_dependencies, + ('trytond_gis', os.path.join(root, 'trytond-gis'))) + +for module in os.listdir(module_path): + path = os.path.join(module_path, module) + if not os.path.isdir(path): + continue + pool.apply_async( + add_dependencies, ('trytond_%s' % module, path)) + +pool.close() +pool.join() + +with io.open(os.path.join(root, 'requirements.txt'), 'w') as fp: + fp.writelines(map(lambda d: d + '\n', sorted(dependencies))) + +with io.open(os.path.join(root, 'requirements-dev.txt'), 'w') as fp: + fp.writelines(map(lambda d: d + '\n', sorted(development_dependencies))) diff --git a/README.rst b/README.rst new file mode 100644 index 0000000000..42b17c5ff8 --- /dev/null +++ b/README.rst @@ -0,0 +1,23 @@ +This repository contains all the packages of Tryton. + +To have symlinks for modules created automatically on Mercurial update, add +the following line to the hooks section of your .hg/hgrc: + + update.modules = .hooks/link_modules + +To automatically generate requirements files on Mercurial update, add +the following line to the hooks section of your .hg/hgrc: + + update.requirements = .hooks/update_requirements + +.. warning:: + + The process of updating requirements files may take some time + +Then you can install the required dependencies with: + + pip install -r requirements.txt + +And you can also install the development dependencies with: + + pip install -r requirements-dev.txt diff --git a/modules/account/.drone.yml b/modules/account/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account/doc/conf.py b/modules/account/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/account/doc/conf.py +++ b/modules/account/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account/setup.py b/modules/account/setup.py index 5d53e992ac..ff536cc41c 100755 --- a/modules/account/setup.py +++ b/modules/account/setup.py @@ -42,23 +42,6 @@ name = 'trytond_account' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-dateutil', 'python-sql >= 0.7', 'simpleeval'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account/tox.ini b/modules/account/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account/tox.ini +++ b/modules/account/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_asset/.drone.yml b/modules/account_asset/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_asset/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_asset/.flake8 b/modules/account_asset/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_asset/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_asset/doc/conf.py b/modules/account_asset/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_asset/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_asset/setup.py b/modules/account_asset/setup.py index ada9366885..9a34cad8b8 100755 --- a/modules/account_asset/setup.py +++ b/modules/account_asset/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_asset' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-dateutil'] for dep in info.get('depends', []): @@ -65,12 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_purchase')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, @@ -140,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_asset/tox.ini b/modules/account_asset/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_asset/tox.ini +++ b/modules/account_asset/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_be/.drone.yml b/modules/account_be/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_be/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_be/.flake8 b/modules/account_be/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_be/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_be/doc/conf.py b/modules/account_be/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_be/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_be/setup.py b/modules/account_be/setup.py index 871a0d62a7..9f96a2b28f 100755 --- a/modules/account_be/setup.py +++ b/modules/account_be/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_be' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with Belgian chart of accounts', @@ -118,7 +95,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_be/tox.ini b/modules/account_be/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_be/tox.ini +++ b/modules/account_be/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_cash_rounding/.drone.yml b/modules/account_cash_rounding/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_cash_rounding/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_cash_rounding/.flake8 b/modules/account_cash_rounding/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_cash_rounding/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_cash_rounding/doc/conf.py b/modules/account_cash_rounding/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_cash_rounding/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_cash_rounding/setup.py b/modules/account_cash_rounding/setup.py index 4e6deff286..2ccbccb9bf 100755 --- a/modules/account_cash_rounding/setup.py +++ b/modules/account_cash_rounding/setup.py @@ -42,23 +42,6 @@ name = 'trytond_account_cash_rounding' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -69,11 +52,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for extra in info.get('extras_depend', []): tests_require.append(get_require_version('trytond_%s' % extra)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -144,7 +122,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_cash_rounding/tox.ini b/modules/account_cash_rounding/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_cash_rounding/tox.ini +++ b/modules/account_cash_rounding/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_credit_limit/.drone.yml b/modules/account_credit_limit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_credit_limit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_credit_limit/.flake8 b/modules/account_credit_limit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_credit_limit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_credit_limit/doc/conf.py b/modules/account_credit_limit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_credit_limit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_credit_limit/setup.py b/modules/account_credit_limit/setup.py index 13f14089d1..67f9bf1075 100755 --- a/modules/account_credit_limit/setup.py +++ b/modules/account_credit_limit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_credit_limit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_account_dunning')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_credit_limit/tox.ini b/modules/account_credit_limit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_credit_limit/tox.ini +++ b/modules/account_credit_limit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_de_skr03/.drone.yml b/modules/account_de_skr03/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_de_skr03/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_de_skr03/.flake8 b/modules/account_de_skr03/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_de_skr03/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_de_skr03/doc/conf.py b/modules/account_de_skr03/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_de_skr03/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_de_skr03/setup.py b/modules/account_de_skr03/setup.py index ab94b3b083..5a8e2b40ae 100755 --- a/modules/account_de_skr03/setup.py +++ b/modules/account_de_skr03/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_de_skr03' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with German chart of accounts SKR03', @@ -117,7 +94,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_de_skr03/tox.ini b/modules/account_de_skr03/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_de_skr03/tox.ini +++ b/modules/account_de_skr03/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_deposit/.drone.yml b/modules/account_deposit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_deposit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_deposit/.flake8 b/modules/account_deposit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_deposit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_deposit/doc/conf.py b/modules/account_deposit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_deposit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_deposit/setup.py b/modules/account_deposit/setup.py index 66421bc2dd..3ec61dfc4a 100755 --- a/modules/account_deposit/setup.py +++ b/modules/account_deposit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_deposit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-dateutil', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_deposit/tox.ini b/modules/account_deposit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_deposit/tox.ini +++ b/modules/account_deposit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_dunning/.drone.yml b/modules/account_dunning/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_dunning/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_dunning/.flake8 b/modules/account_dunning/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_dunning/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_dunning/doc/conf.py b/modules/account_dunning/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_dunning/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_dunning/setup.py b/modules/account_dunning/setup.py index e05454c5cb..70e9981f72 100755 --- a/modules/account_dunning/setup.py +++ b/modules/account_dunning/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_dunning' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_dunning/tox.ini b/modules/account_dunning/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_dunning/tox.ini +++ b/modules/account_dunning/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_dunning_email/.drone.yml b/modules/account_dunning_email/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_dunning_email/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_dunning_email/.flake8 b/modules/account_dunning_email/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_dunning_email/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_dunning_email/doc/conf.py b/modules/account_dunning_email/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_dunning_email/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_dunning_email/setup.py b/modules/account_dunning_email/setup.py index 40a9fa81c4..622aa55e9c 100755 --- a/modules/account_dunning_email/setup.py +++ b/modules/account_dunning_email/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_dunning_email' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_dunning_email/tox.ini b/modules/account_dunning_email/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_dunning_email/tox.ini +++ b/modules/account_dunning_email/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_dunning_fee/.drone.yml b/modules/account_dunning_fee/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_dunning_fee/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_dunning_fee/.flake8 b/modules/account_dunning_fee/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_dunning_fee/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_dunning_fee/doc/conf.py b/modules/account_dunning_fee/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_dunning_fee/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_dunning_fee/setup.py b/modules/account_dunning_fee/setup.py index 703ee2dc23..141c1fc4e0 100755 --- a/modules/account_dunning_fee/setup.py +++ b/modules/account_dunning_fee/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_dunning_fee' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_account_dunning_letter')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_dunning_fee/tox.ini b/modules/account_dunning_fee/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_dunning_fee/tox.ini +++ b/modules/account_dunning_fee/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_dunning_letter/.drone.yml b/modules/account_dunning_letter/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_dunning_letter/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_dunning_letter/.flake8 b/modules/account_dunning_letter/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_dunning_letter/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_dunning_letter/doc/conf.py b/modules/account_dunning_letter/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_dunning_letter/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_dunning_letter/setup.py b/modules/account_dunning_letter/setup.py index d6de6f3635..a5800589a6 100755 --- a/modules/account_dunning_letter/setup.py +++ b/modules/account_dunning_letter/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_dunning_letter' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_dunning_letter/tox.ini b/modules/account_dunning_letter/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_dunning_letter/tox.ini +++ b/modules/account_dunning_letter/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_es/.drone.yml b/modules/account_es/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_es/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_es/.flake8 b/modules/account_es/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_es/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_es/doc/conf.py b/modules/account_es/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_es/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_es/setup.py b/modules/account_es/setup.py index 4810076887..1a5783ba0a 100755 --- a/modules/account_es/setup.py +++ b/modules/account_es/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_es' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 1.1.0'] for dep in info.get('depends', []): @@ -68,11 +51,6 @@ tests_require = [ get_require_version('trytond_account_asset'), get_require_version('trytond_account_payment_sepa'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -123,7 +101,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_es/tox.ini b/modules/account_es/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_es/tox.ini +++ b/modules/account_es/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_eu/.drone.yml b/modules/account_eu/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_eu/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_eu/.flake8 b/modules/account_eu/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_eu/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_eu/doc/conf.py b/modules/account_eu/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_eu/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_eu/setup.py b/modules/account_eu/setup.py index d17efecbbc..f9a46f1ced 100755 --- a/modules/account_eu/setup.py +++ b/modules/account_eu/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_eu' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -135,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_eu/tox.ini b/modules/account_eu/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_eu/tox.ini +++ b/modules/account_eu/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_fr/.drone.yml b/modules/account_fr/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_fr/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_fr/.flake8 b/modules/account_fr/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_fr/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_fr/doc/conf.py b/modules/account_fr/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_fr/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_fr/setup.py b/modules/account_fr/setup.py index 664a71bca3..43a1e65c82 100755 --- a/modules/account_fr/setup.py +++ b/modules/account_fr/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_fr' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), 'python-dateutil'] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_fr/tox.ini b/modules/account_fr/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_fr/tox.ini +++ b/modules/account_fr/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_fr_chorus/.drone.yml b/modules/account_fr_chorus/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_fr_chorus/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_fr_chorus/.flake8 b/modules/account_fr_chorus/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_fr_chorus/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_fr_chorus/doc/conf.py b/modules/account_fr_chorus/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_fr_chorus/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_fr_chorus/setup.py b/modules/account_fr_chorus/setup.py index 974952850c..f43699e99b 100755 --- a/modules/account_fr_chorus/setup.py +++ b/modules/account_fr_chorus/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_fr_chorus' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['requests'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_edocument_uncefact')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_fr_chorus/tox.ini b/modules/account_fr_chorus/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_fr_chorus/tox.ini +++ b/modules/account_fr_chorus/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice/.drone.yml b/modules/account_invoice/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice/.flake8 b/modules/account_invoice/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice/doc/conf.py b/modules/account_invoice/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/account_invoice/doc/conf.py +++ b/modules/account_invoice/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice/setup.py b/modules/account_invoice/setup.py index a28abda9f3..1baaa721cb 100755 --- a/modules/account_invoice/setup.py +++ b/modules/account_invoice/setup.py @@ -42,23 +42,6 @@ name = 'trytond_account_invoice' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-dateutil', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice/tox.ini b/modules/account_invoice/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice/tox.ini +++ b/modules/account_invoice/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice_correction/.drone.yml b/modules/account_invoice_correction/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice_correction/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice_correction/.flake8 b/modules/account_invoice_correction/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice_correction/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice_correction/doc/conf.py b/modules/account_invoice_correction/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_invoice_correction/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice_correction/setup.py b/modules/account_invoice_correction/setup.py index 02ce01c604..7a756f0db3 100755 --- a/modules/account_invoice_correction/setup.py +++ b/modules/account_invoice_correction/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_invoice_correction' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice_correction/tox.ini b/modules/account_invoice_correction/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice_correction/tox.ini +++ b/modules/account_invoice_correction/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice_defer/.drone.yml b/modules/account_invoice_defer/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice_defer/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice_defer/.flake8 b/modules/account_invoice_defer/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice_defer/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice_defer/doc/conf.py b/modules/account_invoice_defer/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/account_invoice_defer/doc/conf.py +++ b/modules/account_invoice_defer/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice_defer/setup.py b/modules/account_invoice_defer/setup.py index 3434b5aa41..72c08892e3 100755 --- a/modules/account_invoice_defer/setup.py +++ b/modules/account_invoice_defer/setup.py @@ -42,24 +42,7 @@ name = 'trytond_account_invoice_defer' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): @@ -67,12 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version) - ) setup(name=name, version=version, @@ -143,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice_defer/tox.ini b/modules/account_invoice_defer/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice_defer/tox.ini +++ b/modules/account_invoice_defer/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice_history/.drone.yml b/modules/account_invoice_history/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice_history/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice_history/.flake8 b/modules/account_invoice_history/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice_history/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice_history/doc/conf.py b/modules/account_invoice_history/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_invoice_history/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice_history/setup.py b/modules/account_invoice_history/setup.py index 4174fffe31..46096ff3f4 100755 --- a/modules/account_invoice_history/setup.py +++ b/modules/account_invoice_history/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_invoice_history' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to historize invoices', @@ -137,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice_history/tox.ini b/modules/account_invoice_history/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice_history/tox.ini +++ b/modules/account_invoice_history/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice_line_standalone/.drone.yml b/modules/account_invoice_line_standalone/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice_line_standalone/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice_line_standalone/.flake8 b/modules/account_invoice_line_standalone/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice_line_standalone/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice_line_standalone/doc/conf.py b/modules/account_invoice_line_standalone/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_invoice_line_standalone/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice_line_standalone/setup.py b/modules/account_invoice_line_standalone/setup.py index e41f44c057..071477ecb9 100755 --- a/modules/account_invoice_line_standalone/setup.py +++ b/modules/account_invoice_line_standalone/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_invoice_line_standalone' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to have standalone invoice lines', @@ -137,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice_line_standalone/tox.ini b/modules/account_invoice_line_standalone/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice_line_standalone/tox.ini +++ b/modules/account_invoice_line_standalone/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice_secondary_unit/.drone.yml b/modules/account_invoice_secondary_unit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice_secondary_unit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice_secondary_unit/.flake8 b/modules/account_invoice_secondary_unit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice_secondary_unit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice_secondary_unit/doc/conf.py b/modules/account_invoice_secondary_unit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_invoice_secondary_unit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice_secondary_unit/setup.py b/modules/account_invoice_secondary_unit/setup.py index e82a7f76ef..8480ebdad7 100755 --- a/modules/account_invoice_secondary_unit/setup.py +++ b/modules/account_invoice_secondary_unit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_invoice_secondary_unit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice_secondary_unit/tox.ini b/modules/account_invoice_secondary_unit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice_secondary_unit/tox.ini +++ b/modules/account_invoice_secondary_unit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_invoice_stock/.drone.yml b/modules/account_invoice_stock/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_invoice_stock/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_invoice_stock/.flake8 b/modules/account_invoice_stock/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_invoice_stock/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_invoice_stock/doc/conf.py b/modules/account_invoice_stock/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/account_invoice_stock/doc/conf.py +++ b/modules/account_invoice_stock/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_invoice_stock/setup.py b/modules/account_invoice_stock/setup.py index 36dd5d4c13..dedc40857b 100755 --- a/modules/account_invoice_stock/setup.py +++ b/modules/account_invoice_stock/setup.py @@ -42,23 +42,6 @@ name = 'trytond_account_invoice_stock' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_invoice_stock/tox.ini b/modules/account_invoice_stock/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_invoice_stock/tox.ini +++ b/modules/account_invoice_stock/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_payment/.drone.yml b/modules/account_payment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_payment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_payment/.flake8 b/modules/account_payment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_payment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_payment/doc/conf.py b/modules/account_payment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_payment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_payment/setup.py b/modules/account_payment/setup.py index 59e198a2f5..7bdbb5150f 100755 --- a/modules/account_payment/setup.py +++ b/modules/account_payment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_payment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for dep in ['account_invoice']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_payment/tox.ini b/modules/account_payment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_payment/tox.ini +++ b/modules/account_payment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_payment_braintree/.drone.yml b/modules/account_payment_braintree/.drone.yml deleted file mode 100644 index e47a077d44..0000000000 --- a/modules/account_payment_braintree/.drone.yml +++ /dev/null @@ -1,69 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID BRAINTREE_MERCHANT_ID BRAINTREE_PUBLIC_KEY BRAINTREE_PRIVATE_KEY - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - secrets: [ braintree_merchant_id, braintree_public_key, braintree_private_key ] - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_payment_braintree/.flake8 b/modules/account_payment_braintree/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_payment_braintree/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_payment_braintree/doc/conf.py b/modules/account_payment_braintree/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_payment_braintree/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_payment_braintree/setup.py b/modules/account_payment_braintree/setup.py index dec38262b5..c84fdad627 100755 --- a/modules/account_payment_braintree/setup.py +++ b/modules/account_payment_braintree/setup.py @@ -42,23 +42,6 @@ name = 'trytond_account_payment_braintree' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['braintree >= 3.38.0', 'werkzeug'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_payment_braintree/tox.ini b/modules/account_payment_braintree/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_payment_braintree/tox.ini +++ b/modules/account_payment_braintree/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_payment_clearing/.drone.yml b/modules/account_payment_clearing/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_payment_clearing/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_payment_clearing/.flake8 b/modules/account_payment_clearing/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_payment_clearing/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_payment_clearing/doc/conf.py b/modules/account_payment_clearing/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_payment_clearing/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_payment_clearing/setup.py b/modules/account_payment_clearing/setup.py index fd38e34f09..0fc4ac7806 100755 --- a/modules/account_payment_clearing/setup.py +++ b/modules/account_payment_clearing/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_payment_clearing' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [get_require_version('proteus'), get_require_version('trytond_account_statement'), get_require_version('trytond_account_statement_rule'), 'python-dateutil'] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -143,7 +121,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_payment_clearing/tox.ini b/modules/account_payment_clearing/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_payment_clearing/tox.ini +++ b/modules/account_payment_clearing/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_payment_sepa/.drone.yml b/modules/account_payment_sepa/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_payment_sepa/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_payment_sepa/.flake8 b/modules/account_payment_sepa/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_payment_sepa/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_payment_sepa/doc/conf.py b/modules/account_payment_sepa/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_payment_sepa/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_payment_sepa/setup.py b/modules/account_payment_sepa/setup.py index c650c52782..fe65caa4f3 100755 --- a/modules/account_payment_sepa/setup.py +++ b/modules/account_payment_sepa/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_payment_sepa' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['Genshi', 'lxml', 'python-dateutil', 'python-stdnum >= 1.0'] for dep in info.get('depends', []): @@ -65,12 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module for SEPA payment', @@ -141,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_payment_sepa/tox.ini b/modules/account_payment_sepa/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_payment_sepa/tox.ini +++ b/modules/account_payment_sepa/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_payment_sepa_cfonb/.drone.yml b/modules/account_payment_sepa_cfonb/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_payment_sepa_cfonb/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_payment_sepa_cfonb/.flake8 b/modules/account_payment_sepa_cfonb/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_payment_sepa_cfonb/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_payment_sepa_cfonb/doc/conf.py b/modules/account_payment_sepa_cfonb/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_payment_sepa_cfonb/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_payment_sepa_cfonb/setup.py b/modules/account_payment_sepa_cfonb/setup.py index 01b2947aec..2145b859f5 100755 --- a/modules/account_payment_sepa_cfonb/setup.py +++ b/modules/account_payment_sepa_cfonb/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_payment_sepa_cfonb' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['Genshi', 'lxml'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_payment_sepa_cfonb/tox.ini b/modules/account_payment_sepa_cfonb/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_payment_sepa_cfonb/tox.ini +++ b/modules/account_payment_sepa_cfonb/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_payment_stripe/.drone.yml b/modules/account_payment_stripe/.drone.yml deleted file mode 100644 index 15521a0b77..0000000000 --- a/modules/account_payment_stripe/.drone.yml +++ /dev/null @@ -1,69 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID STRIPE_SECRET_KEY STRIPE_PUBLISHABLE_KEY - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - secrets: [ stripe_secret_key, stripe_publishable_key ] - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_payment_stripe/.flake8 b/modules/account_payment_stripe/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_payment_stripe/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_payment_stripe/doc/conf.py b/modules/account_payment_stripe/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_payment_stripe/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_payment_stripe/setup.py b/modules/account_payment_stripe/setup.py index 2684f199f9..a6426be838 100755 --- a/modules/account_payment_stripe/setup.py +++ b/modules/account_payment_stripe/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_payment_stripe' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['stripe >= 2.32.0', 'werkzeug'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_payment_stripe/tox.ini b/modules/account_payment_stripe/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_payment_stripe/tox.ini +++ b/modules/account_payment_stripe/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_product/.drone.yml b/modules/account_product/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_product/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_product/.flake8 b/modules/account_product/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_product/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_product/doc/conf.py b/modules/account_product/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/account_product/doc/conf.py +++ b/modules/account_product/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_product/setup.py b/modules/account_product/setup.py index 9dfaf27eae..6c51e8257a 100755 --- a/modules/account_product/setup.py +++ b/modules/account_product/setup.py @@ -42,23 +42,6 @@ name = 'trytond_account_product' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_analytic_account')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_product/tox.ini b/modules/account_product/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_product/tox.ini +++ b/modules/account_product/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_statement/.drone.yml b/modules/account_statement/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_statement/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_statement/.flake8 b/modules/account_statement/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_statement/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_statement/doc/conf.py b/modules/account_statement/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_statement/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_statement/setup.py b/modules/account_statement/setup.py index 6626e76759..e7a7f3aabe 100755 --- a/modules/account_statement/setup.py +++ b/modules/account_statement/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_statement' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_statement/tox.ini b/modules/account_statement/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_statement/tox.ini +++ b/modules/account_statement/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_statement_aeb43/.drone.yml b/modules/account_statement_aeb43/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_statement_aeb43/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_statement_aeb43/.flake8 b/modules/account_statement_aeb43/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_statement_aeb43/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_statement_aeb43/doc/conf.py b/modules/account_statement_aeb43/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_statement_aeb43/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_statement_aeb43/setup.py b/modules/account_statement_aeb43/setup.py index d02e864a06..03f29b9b2d 100755 --- a/modules/account_statement_aeb43/setup.py +++ b/modules/account_statement_aeb43/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_statement_aeb43' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-stdnum', 'csb43>=0.8'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_statement_aeb43/tox.ini b/modules/account_statement_aeb43/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_statement_aeb43/tox.ini +++ b/modules/account_statement_aeb43/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_statement_coda/.drone.yml b/modules/account_statement_coda/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_statement_coda/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_statement_coda/.flake8 b/modules/account_statement_coda/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_statement_coda/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_statement_coda/doc/conf.py b/modules/account_statement_coda/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_statement_coda/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_statement_coda/setup.py b/modules/account_statement_coda/setup.py index b7a0ba89ea..2ec154efff 100755 --- a/modules/account_statement_coda/setup.py +++ b/modules/account_statement_coda/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_statement_coda' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['febelfin-coda'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_statement_coda/tox.ini b/modules/account_statement_coda/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_statement_coda/tox.ini +++ b/modules/account_statement_coda/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_statement_ofx/.drone.yml b/modules/account_statement_ofx/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_statement_ofx/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_statement_ofx/.flake8 b/modules/account_statement_ofx/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_statement_ofx/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_statement_ofx/doc/conf.py b/modules/account_statement_ofx/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_statement_ofx/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_statement_ofx/setup.py b/modules/account_statement_ofx/setup.py index 9a04503a14..221e9efce5 100755 --- a/modules/account_statement_ofx/setup.py +++ b/modules/account_statement_ofx/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_statement_ofx' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['ofxparse'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_statement_ofx/tox.ini b/modules/account_statement_ofx/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_statement_ofx/tox.ini +++ b/modules/account_statement_ofx/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_statement_rule/.drone.yml b/modules/account_statement_rule/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_statement_rule/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_statement_rule/.flake8 b/modules/account_statement_rule/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_statement_rule/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_statement_rule/doc/conf.py b/modules/account_statement_rule/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_statement_rule/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_statement_rule/setup.py b/modules/account_statement_rule/setup.py index 779b6e9c8a..5d370cfa13 100755 --- a/modules/account_statement_rule/setup.py +++ b/modules/account_statement_rule/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_statement_rule' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_statement_rule/tox.ini b/modules/account_statement_rule/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_statement_rule/tox.ini +++ b/modules/account_statement_rule/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_stock_anglo_saxon/.drone.yml b/modules/account_stock_anglo_saxon/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_stock_anglo_saxon/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_stock_anglo_saxon/.flake8 b/modules/account_stock_anglo_saxon/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_stock_anglo_saxon/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_stock_anglo_saxon/doc/conf.py b/modules/account_stock_anglo_saxon/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_stock_anglo_saxon/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_stock_anglo_saxon/setup.py b/modules/account_stock_anglo_saxon/setup.py index e4109bed07..d31076915a 100755 --- a/modules/account_stock_anglo_saxon/setup.py +++ b/modules/account_stock_anglo_saxon/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_stock_anglo_saxon' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [get_require_version('proteus'), get_require_version('trytond_sale_supply_drop_shipment'), get_require_version('trytond_sale'), get_require_version('trytond_purchase')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_stock_anglo_saxon/tox.ini b/modules/account_stock_anglo_saxon/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_stock_anglo_saxon/tox.ini +++ b/modules/account_stock_anglo_saxon/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_stock_continental/.drone.yml b/modules/account_stock_continental/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_stock_continental/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_stock_continental/.flake8 b/modules/account_stock_continental/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_stock_continental/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_stock_continental/doc/conf.py b/modules/account_stock_continental/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_stock_continental/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_stock_continental/setup.py b/modules/account_stock_continental/setup.py index 4a8e48fc90..d876548636 100755 --- a/modules/account_stock_continental/setup.py +++ b/modules/account_stock_continental/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_stock_continental' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [get_require_version('proteus')] for dep in ['sale', 'purchase', 'account_invoice', 'sale_supply_drop_shipment']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_stock_continental/tox.ini b/modules/account_stock_continental/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_stock_continental/tox.ini +++ b/modules/account_stock_continental/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_stock_landed_cost/.drone.yml b/modules/account_stock_landed_cost/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_stock_landed_cost/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_stock_landed_cost/.flake8 b/modules/account_stock_landed_cost/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_stock_landed_cost/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_stock_landed_cost/doc/conf.py b/modules/account_stock_landed_cost/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_stock_landed_cost/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_stock_landed_cost/setup.py b/modules/account_stock_landed_cost/setup.py index a0f1aa4018..4fdd8ba99e 100755 --- a/modules/account_stock_landed_cost/setup.py +++ b/modules/account_stock_landed_cost/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_stock_landed_cost' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_stock_landed_cost/tox.ini b/modules/account_stock_landed_cost/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_stock_landed_cost/tox.ini +++ b/modules/account_stock_landed_cost/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_stock_landed_cost_weight/.drone.yml b/modules/account_stock_landed_cost_weight/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_stock_landed_cost_weight/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_stock_landed_cost_weight/.flake8 b/modules/account_stock_landed_cost_weight/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_stock_landed_cost_weight/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_stock_landed_cost_weight/doc/conf.py b/modules/account_stock_landed_cost_weight/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_stock_landed_cost_weight/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_stock_landed_cost_weight/setup.py b/modules/account_stock_landed_cost_weight/setup.py index 7e612f1139..2ccae5b598 100755 --- a/modules/account_stock_landed_cost_weight/setup.py +++ b/modules/account_stock_landed_cost_weight/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_stock_landed_cost_weight' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_stock_landed_cost_weight/tox.ini b/modules/account_stock_landed_cost_weight/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_stock_landed_cost_weight/tox.ini +++ b/modules/account_stock_landed_cost_weight/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_tax_cash/.drone.yml b/modules/account_tax_cash/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_tax_cash/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_tax_cash/.flake8 b/modules/account_tax_cash/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_tax_cash/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_tax_cash/doc/conf.py b/modules/account_tax_cash/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_tax_cash/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_tax_cash/setup.py b/modules/account_tax_cash/setup.py index 4b06e5260a..f6903d7962 100755 --- a/modules/account_tax_cash/setup.py +++ b/modules/account_tax_cash/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_tax_cash' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -135,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_tax_cash/tox.ini b/modules/account_tax_cash/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_tax_cash/tox.ini +++ b/modules/account_tax_cash/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/account_tax_rule_country/.drone.yml b/modules/account_tax_rule_country/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/account_tax_rule_country/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/account_tax_rule_country/.flake8 b/modules/account_tax_rule_country/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/account_tax_rule_country/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/account_tax_rule_country/doc/conf.py b/modules/account_tax_rule_country/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/account_tax_rule_country/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/account_tax_rule_country/setup.py b/modules/account_tax_rule_country/setup.py index c1b3a572ad..4524f000d9 100755 --- a/modules/account_tax_rule_country/setup.py +++ b/modules/account_tax_rule_country/setup.py @@ -39,23 +39,6 @@ name = 'trytond_account_tax_rule_country' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [] for dep in ['account_invoice', 'sale', 'purchase', 'stock']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/account_tax_rule_country/tox.ini b/modules/account_tax_rule_country/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/account_tax_rule_country/tox.ini +++ b/modules/account_tax_rule_country/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/analytic_account/.drone.yml b/modules/analytic_account/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/analytic_account/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/analytic_account/.flake8 b/modules/analytic_account/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/analytic_account/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/analytic_account/doc/conf.py b/modules/analytic_account/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/analytic_account/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/analytic_account/setup.py b/modules/analytic_account/setup.py index fd569ebc19..570fe41f15 100755 --- a/modules/analytic_account/setup.py +++ b/modules/analytic_account/setup.py @@ -39,23 +39,6 @@ name = 'trytond_analytic_account' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/analytic_account/tox.ini b/modules/analytic_account/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/analytic_account/tox.ini +++ b/modules/analytic_account/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/analytic_invoice/.drone.yml b/modules/analytic_invoice/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/analytic_invoice/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/analytic_invoice/.flake8 b/modules/analytic_invoice/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/analytic_invoice/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/analytic_invoice/doc/conf.py b/modules/analytic_invoice/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/analytic_invoice/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/analytic_invoice/setup.py b/modules/analytic_invoice/setup.py index 285f2f510d..4e4f641dda 100755 --- a/modules/analytic_invoice/setup.py +++ b/modules/analytic_invoice/setup.py @@ -39,23 +39,6 @@ name = 'trytond_analytic_invoice' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for dep in ['account_asset']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/analytic_invoice/tox.ini b/modules/analytic_invoice/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/analytic_invoice/tox.ini +++ b/modules/analytic_invoice/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/analytic_purchase/.drone.yml b/modules/analytic_purchase/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/analytic_purchase/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/analytic_purchase/.flake8 b/modules/analytic_purchase/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/analytic_purchase/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/analytic_purchase/doc/conf.py b/modules/analytic_purchase/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/analytic_purchase/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/analytic_purchase/setup.py b/modules/analytic_purchase/setup.py index 659e7e7e48..527960bf37 100755 --- a/modules/analytic_purchase/setup.py +++ b/modules/analytic_purchase/setup.py @@ -39,23 +39,6 @@ name = 'trytond_analytic_purchase' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/analytic_purchase/tox.ini b/modules/analytic_purchase/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/analytic_purchase/tox.ini +++ b/modules/analytic_purchase/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/analytic_sale/.drone.yml b/modules/analytic_sale/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/analytic_sale/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/analytic_sale/.flake8 b/modules/analytic_sale/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/analytic_sale/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/analytic_sale/doc/conf.py b/modules/analytic_sale/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/analytic_sale/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/analytic_sale/setup.py b/modules/analytic_sale/setup.py index 584e6588fa..c30d93cf00 100755 --- a/modules/analytic_sale/setup.py +++ b/modules/analytic_sale/setup.py @@ -39,23 +39,6 @@ name = 'trytond_analytic_sale' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/analytic_sale/tox.ini b/modules/analytic_sale/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/analytic_sale/tox.ini +++ b/modules/analytic_sale/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/attendance/.drone.yml b/modules/attendance/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/attendance/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/attendance/.flake8 b/modules/attendance/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/attendance/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/attendance/doc/conf.py b/modules/attendance/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/attendance/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/attendance/setup.py b/modules/attendance/setup.py index eac5f32b96..0f77a3fdda 100755 --- a/modules/attendance/setup.py +++ b/modules/attendance/setup.py @@ -42,23 +42,6 @@ name = 'trytond_attendance' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -70,11 +53,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_timesheet'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -144,7 +122,6 @@ setup(name=name, extras_require={ 'timezone': ['pytz'], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/attendance/tox.ini b/modules/attendance/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/attendance/tox.ini +++ b/modules/attendance/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/authentication_sms/.drone.yml b/modules/authentication_sms/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/authentication_sms/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/authentication_sms/.flake8 b/modules/authentication_sms/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/authentication_sms/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/authentication_sms/doc/conf.py b/modules/authentication_sms/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/authentication_sms/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/authentication_sms/setup.py b/modules/authentication_sms/setup.py index ebaec81b5d..a54140ccd5 100755 --- a/modules/authentication_sms/setup.py +++ b/modules/authentication_sms/setup.py @@ -39,23 +39,6 @@ name = 'trytond_authentication_sms' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/authentication_sms/tox.ini b/modules/authentication_sms/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/authentication_sms/tox.ini +++ b/modules/authentication_sms/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/bank/.drone.yml b/modules/bank/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/bank/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/bank/.flake8 b/modules/bank/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/bank/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/bank/doc/conf.py b/modules/bank/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/bank/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/bank/setup.py b/modules/bank/setup.py index d35e6a2bf4..40af20c78b 100755 --- a/modules/bank/setup.py +++ b/modules/bank/setup.py @@ -39,23 +39,6 @@ name = 'trytond_bank' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-stdnum', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with banks', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/bank/tox.ini b/modules/bank/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/bank/tox.ini +++ b/modules/bank/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/carrier/.drone.yml b/modules/carrier/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/carrier/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/carrier/.flake8 b/modules/carrier/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/carrier/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/carrier/doc/conf.py b/modules/carrier/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/carrier/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/carrier/setup.py b/modules/carrier/setup.py index 3f608b848e..687180617c 100755 --- a/modules/carrier/setup.py +++ b/modules/carrier/setup.py @@ -39,23 +39,6 @@ name = 'trytond_carrier' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with carriers', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/carrier/tox.ini b/modules/carrier/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/carrier/tox.ini +++ b/modules/carrier/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/carrier_percentage/.drone.yml b/modules/carrier_percentage/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/carrier_percentage/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/carrier_percentage/.flake8 b/modules/carrier_percentage/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/carrier_percentage/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/carrier_percentage/doc/conf.py b/modules/carrier_percentage/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/carrier_percentage/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/carrier_percentage/setup.py b/modules/carrier_percentage/setup.py index 0ab5c4a24c..8f2985c340 100755 --- a/modules/carrier_percentage/setup.py +++ b/modules/carrier_percentage/setup.py @@ -39,23 +39,6 @@ name = 'trytond_carrier_percentage' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_purchase_shipment_cost'), get_require_version('trytond_sale_shipment_cost')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/carrier_percentage/tox.ini b/modules/carrier_percentage/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/carrier_percentage/tox.ini +++ b/modules/carrier_percentage/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/carrier_subdivision/.drone.yml b/modules/carrier_subdivision/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/carrier_subdivision/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/carrier_subdivision/.flake8 b/modules/carrier_subdivision/.flake8 deleted file mode 100644 index bb03d08a82..0000000000 --- a/modules/carrier_subdivision/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,W503 diff --git a/modules/carrier_subdivision/doc/conf.py b/modules/carrier_subdivision/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/carrier_subdivision/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/carrier_subdivision/setup.py b/modules/carrier_subdivision/setup.py index 3ed5a4eac5..a61c53a4fc 100755 --- a/modules/carrier_subdivision/setup.py +++ b/modules/carrier_subdivision/setup.py @@ -42,23 +42,6 @@ name = 'trytond_carrier_subdivision' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -70,11 +53,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_sale_shipment_cost'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -145,7 +123,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/carrier_subdivision/tox.ini b/modules/carrier_subdivision/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/carrier_subdivision/tox.ini +++ b/modules/carrier_subdivision/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/carrier_weight/.drone.yml b/modules/carrier_weight/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/carrier_weight/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/carrier_weight/.flake8 b/modules/carrier_weight/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/carrier_weight/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/carrier_weight/doc/conf.py b/modules/carrier_weight/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/carrier_weight/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/carrier_weight/setup.py b/modules/carrier_weight/setup.py index 399c40aff4..baaaf30649 100755 --- a/modules/carrier_weight/setup.py +++ b/modules/carrier_weight/setup.py @@ -39,23 +39,6 @@ name = 'trytond_carrier_weight' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_purchase_shipment_cost'), get_require_version('trytond_sale_shipment_cost')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/carrier_weight/tox.ini b/modules/carrier_weight/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/carrier_weight/tox.ini +++ b/modules/carrier_weight/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/commission/.drone.yml b/modules/commission/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/commission/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/commission/.flake8 b/modules/commission/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/commission/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/commission/setup.py b/modules/commission/setup.py index c9f146fdad..90cfb5ea69 100755 --- a/modules/commission/setup.py +++ b/modules/commission/setup.py @@ -39,23 +39,6 @@ name = 'trytond_commission' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['simpleeval', 'python-sql'] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_sale')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/commission/tox.ini b/modules/commission/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/commission/tox.ini +++ b/modules/commission/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/commission_waiting/.drone.yml b/modules/commission_waiting/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/commission_waiting/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/commission_waiting/.flake8 b/modules/commission_waiting/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/commission_waiting/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/commission_waiting/doc/conf.py b/modules/commission_waiting/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/commission_waiting/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/commission_waiting/setup.py b/modules/commission_waiting/setup.py index 57d9048f14..e822ec77bc 100755 --- a/modules/commission_waiting/setup.py +++ b/modules/commission_waiting/setup.py @@ -39,23 +39,6 @@ name = 'trytond_commission_waiting' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/commission_waiting/tox.ini b/modules/commission_waiting/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/commission_waiting/tox.ini +++ b/modules/commission_waiting/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/company/.drone.yml b/modules/company/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/company/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/company/.flake8 b/modules/company/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/company/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/company/doc/conf.py b/modules/company/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/company/doc/conf.py +++ b/modules/company/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/company/setup.py b/modules/company/setup.py index 26bb68c30e..6fef678436 100755 --- a/modules/company/setup.py +++ b/modules/company/setup.py @@ -42,23 +42,6 @@ name = 'trytond_company' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -66,12 +49,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with companies and employees', @@ -143,7 +120,6 @@ setup(name=name, extras_require={ 'timezone': ['pytz'], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/company/tox.ini b/modules/company/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/company/tox.ini +++ b/modules/company/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/company_work_time/.drone.yml b/modules/company_work_time/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/company_work_time/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/company_work_time/.flake8 b/modules/company_work_time/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/company_work_time/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/company_work_time/doc/conf.py b/modules/company_work_time/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/company_work_time/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/company_work_time/setup.py b/modules/company_work_time/setup.py index 419c792c5f..61aa61bebc 100755 --- a/modules/company_work_time/setup.py +++ b/modules/company_work_time/setup.py @@ -39,23 +39,6 @@ name = 'trytond_company_work_time' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add work time on company', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/company_work_time/tox.ini b/modules/company_work_time/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/company_work_time/tox.ini +++ b/modules/company_work_time/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/country/.drone.yml b/modules/country/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/country/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/country/.flake8 b/modules/country/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/country/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/country/doc/conf.py b/modules/country/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/country/doc/conf.py +++ b/modules/country/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/country/setup.py b/modules/country/setup.py index 95338f84ff..dafe1fc8d1 100755 --- a/modules/country/setup.py +++ b/modules/country/setup.py @@ -42,23 +42,6 @@ name = 'trytond_country' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), 'pycountry<=20.7.3'] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -145,7 +123,6 @@ setup(name=name, 'data': ['pycountry<=20.7.3', get_require_version('proteus')], 'GeoNames': [get_require_version('proteus')], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/country/tox.ini b/modules/country/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/country/tox.ini +++ b/modules/country/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/currency/.drone.yml b/modules/currency/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/currency/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/currency/.flake8 b/modules/currency/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/currency/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/currency/doc/conf.py b/modules/currency/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/currency/doc/conf.py +++ b/modules/currency/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/currency/setup.py b/modules/currency/setup.py index 913a77afb1..46b1591ac7 100755 --- a/modules/currency/setup.py +++ b/modules/currency/setup.py @@ -42,23 +42,6 @@ name = 'trytond_currency' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.9', 'python-dateutil'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), 'pycountry'] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -145,7 +123,6 @@ setup(name=name, extras_require={ 'data': ['pycountry', get_require_version('proteus')], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/currency/tox.ini b/modules/currency/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/currency/tox.ini +++ b/modules/currency/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/customs/.drone.yml b/modules/customs/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/customs/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/customs/.flake8 b/modules/customs/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/customs/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/customs/doc/conf.py b/modules/customs/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/customs/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/customs/setup.py b/modules/customs/setup.py index 3b6be76c71..65a29f8d7e 100755 --- a/modules/customs/setup.py +++ b/modules/customs/setup.py @@ -39,23 +39,6 @@ name = 'trytond_customs' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['simpleeval', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module for customs', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/customs/tox.ini b/modules/customs/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/customs/tox.ini +++ b/modules/customs/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/dashboard/.drone.yml b/modules/dashboard/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/dashboard/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/dashboard/.flake8 b/modules/dashboard/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/dashboard/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/dashboard/doc/conf.py b/modules/dashboard/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/dashboard/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/dashboard/setup.py b/modules/dashboard/setup.py index 7d40a3cc78..6ebea9633f 100755 --- a/modules/dashboard/setup.py +++ b/modules/dashboard/setup.py @@ -39,23 +39,6 @@ name = 'trytond_dashboard' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['lxml', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module for dashboard', @@ -134,7 +111,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/dashboard/tox.ini b/modules/dashboard/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/dashboard/tox.ini +++ b/modules/dashboard/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/edocument_uncefact/.drone.yml b/modules/edocument_uncefact/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/edocument_uncefact/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/edocument_uncefact/.flake8 b/modules/edocument_uncefact/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/edocument_uncefact/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/edocument_uncefact/doc/conf.py b/modules/edocument_uncefact/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/edocument_uncefact/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/edocument_uncefact/setup.py b/modules/edocument_uncefact/setup.py index 0f5be67f4c..c838875c3e 100755 --- a/modules/edocument_uncefact/setup.py +++ b/modules/edocument_uncefact/setup.py @@ -39,23 +39,6 @@ name = 'trytond_edocument_uncefact' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['Genshi'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [ 'lxml', get_require_version('trytond_account_invoice'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/edocument_uncefact/tox.ini b/modules/edocument_uncefact/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/edocument_uncefact/tox.ini +++ b/modules/edocument_uncefact/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/edocument_unece/.drone.yml b/modules/edocument_unece/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/edocument_unece/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/edocument_unece/.flake8 b/modules/edocument_unece/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/edocument_unece/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/edocument_unece/doc/conf.py b/modules/edocument_unece/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/edocument_unece/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/edocument_unece/setup.py b/modules/edocument_unece/setup.py index b5178523bb..e4991d9a2b 100755 --- a/modules/edocument_unece/setup.py +++ b/modules/edocument_unece/setup.py @@ -39,23 +39,6 @@ name = 'trytond_edocument_unece' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/edocument_unece/tox.ini b/modules/edocument_unece/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/edocument_unece/tox.ini +++ b/modules/edocument_unece/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/google_maps/.drone.yml b/modules/google_maps/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/google_maps/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/google_maps/.flake8 b/modules/google_maps/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/google_maps/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/google_maps/doc/conf.py b/modules/google_maps/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/google_maps/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/google_maps/setup.py b/modules/google_maps/setup.py index 86a17fced8..275c9e4362 100755 --- a/modules/google_maps/setup.py +++ b/modules/google_maps/setup.py @@ -39,23 +39,6 @@ name = 'trytond_google_maps' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to link addresses to Google Maps', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/google_maps/tox.ini b/modules/google_maps/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/google_maps/tox.ini +++ b/modules/google_maps/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/incoterm/.drone.yml b/modules/incoterm/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/incoterm/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/incoterm/.flake8 b/modules/incoterm/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/incoterm/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/incoterm/doc/conf.py b/modules/incoterm/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/incoterm/doc/conf.py +++ b/modules/incoterm/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/incoterm/setup.py b/modules/incoterm/setup.py index 7271328ae5..d50ae4a68f 100755 --- a/modules/incoterm/setup.py +++ b/modules/incoterm/setup.py @@ -42,24 +42,7 @@ name = 'trytond_incoterm' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): @@ -80,12 +63,6 @@ tests_require = [ get_require_version('trytond_sale_invoice_grouping'), get_require_version('trytond_stock'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version) - ) setup(name=name, version=version, @@ -155,7 +132,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/incoterm/tox.ini b/modules/incoterm/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/incoterm/tox.ini +++ b/modules/incoterm/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/ldap_authentication/.drone.yml b/modules/ldap_authentication/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/ldap_authentication/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/ldap_authentication/.flake8 b/modules/ldap_authentication/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/ldap_authentication/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/ldap_authentication/doc/conf.py b/modules/ldap_authentication/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/ldap_authentication/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/ldap_authentication/setup.py b/modules/ldap_authentication/setup.py index b14765cbdb..9104464667 100755 --- a/modules/ldap_authentication/setup.py +++ b/modules/ldap_authentication/setup.py @@ -39,23 +39,6 @@ name = 'trytond_ldap_authentication' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['ldap3 >= 2.0.7'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/ldap_authentication/tox.ini b/modules/ldap_authentication/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/ldap_authentication/tox.ini +++ b/modules/ldap_authentication/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/marketing/.drone.yml b/modules/marketing/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/marketing/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/marketing/.flake8 b/modules/marketing/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/marketing/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/marketing/doc/conf.py b/modules/marketing/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/marketing/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/marketing/setup.py b/modules/marketing/setup.py index 9797abba80..2200600c8b 100755 --- a/modules/marketing/setup.py +++ b/modules/marketing/setup.py @@ -39,23 +39,6 @@ name = 'trytond_marketing' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/marketing/tox.ini b/modules/marketing/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/marketing/tox.ini +++ b/modules/marketing/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/marketing_automation/.drone.yml b/modules/marketing_automation/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/marketing_automation/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/marketing_automation/.flake8 b/modules/marketing_automation/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/marketing_automation/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/marketing_automation/doc/conf.py b/modules/marketing_automation/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/marketing_automation/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/marketing_automation/setup.py b/modules/marketing_automation/setup.py index fb5f4eac80..e6e0269f59 100755 --- a/modules/marketing_automation/setup.py +++ b/modules/marketing_automation/setup.py @@ -39,23 +39,6 @@ name = 'trytond_marketing_automation' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['werkzeug', 'Genshi'] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_party')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/marketing_automation/tox.ini b/modules/marketing_automation/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/marketing_automation/tox.ini +++ b/modules/marketing_automation/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/marketing_email/.drone.yml b/modules/marketing_email/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/marketing_email/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/marketing_email/.flake8 b/modules/marketing_email/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/marketing_email/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/marketing_email/doc/conf.py b/modules/marketing_email/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/marketing_email/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/marketing_email/setup.py b/modules/marketing_email/setup.py index 878bd23924..bc2e421199 100755 --- a/modules/marketing_email/setup.py +++ b/modules/marketing_email/setup.py @@ -39,23 +39,6 @@ name = 'trytond_marketing_email' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/marketing_email/tox.ini b/modules/marketing_email/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/marketing_email/tox.ini +++ b/modules/marketing_email/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/notification_email/.drone.yml b/modules/notification_email/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/notification_email/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/notification_email/.flake8 b/modules/notification_email/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/notification_email/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/notification_email/doc/conf.py b/modules/notification_email/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/notification_email/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/notification_email/setup.py b/modules/notification_email/setup.py index 5da74e107a..d3dd36a33e 100755 --- a/modules/notification_email/setup.py +++ b/modules/notification_email/setup.py @@ -39,23 +39,6 @@ name = 'trytond_notification_email' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['Genshi'] for dep in info.get('depends', []): @@ -69,11 +52,6 @@ tests_require = [ get_require_version('trytond_party'), get_require_version('trytond_web_user'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/notification_email/tox.ini b/modules/notification_email/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/notification_email/tox.ini +++ b/modules/notification_email/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/party/.drone.yml b/modules/party/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/party/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/party/.flake8 b/modules/party/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/party/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/party/doc/conf.py b/modules/party/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/party/doc/conf.py +++ b/modules/party/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/party/setup.py b/modules/party/setup.py index 1d3c476b08..f76d61afd7 100755 --- a/modules/party/setup.py +++ b/modules/party/setup.py @@ -42,23 +42,6 @@ name = 'trytond_party' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4', 'python-stdnum >= 1.15'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), 'phonenumbers'] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -145,7 +123,6 @@ setup(name=name, 'VIES': ['python-stdnum[SOAP]'], 'phonenumbers': ['phonenumbers'], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/party/tox.ini b/modules/party/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/party/tox.ini +++ b/modules/party/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/party_avatar/.drone.yml b/modules/party_avatar/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/party_avatar/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/party_avatar/.flake8 b/modules/party_avatar/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/party_avatar/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/party_avatar/doc/conf.py b/modules/party_avatar/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/party_avatar/doc/conf.py +++ b/modules/party_avatar/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/party_avatar/setup.py b/modules/party_avatar/setup.py index 8a64ad4d92..49746bf322 100755 --- a/modules/party_avatar/setup.py +++ b/modules/party_avatar/setup.py @@ -42,24 +42,7 @@ name = 'trytond_party_avatar' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): @@ -67,12 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_company')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version) - ) setup(name=name, version=version, @@ -143,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/party_avatar/tox.ini b/modules/party_avatar/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/party_avatar/tox.ini +++ b/modules/party_avatar/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/party_relationship/.drone.yml b/modules/party_relationship/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/party_relationship/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/party_relationship/.flake8 b/modules/party_relationship/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/party_relationship/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/party_relationship/doc/conf.py b/modules/party_relationship/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/party_relationship/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/party_relationship/setup.py b/modules/party_relationship/setup.py index 49ef24a394..5bc2b1fa38 100755 --- a/modules/party_relationship/setup.py +++ b/modules/party_relationship/setup.py @@ -39,23 +39,6 @@ name = 'trytond_party_relationship' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/party_relationship/tox.ini b/modules/party_relationship/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/party_relationship/tox.ini +++ b/modules/party_relationship/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/party_siret/.drone.yml b/modules/party_siret/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/party_siret/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/party_siret/.flake8 b/modules/party_siret/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/party_siret/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/party_siret/doc/conf.py b/modules/party_siret/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/party_siret/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/party_siret/setup.py b/modules/party_siret/setup.py index 0b3362cb21..811355166f 100755 --- a/modules/party_siret/setup.py +++ b/modules/party_siret/setup.py @@ -39,23 +39,6 @@ name = 'trytond_party_siret' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add SIRET/SIREN on parties', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/party_siret/tox.ini b/modules/party_siret/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/party_siret/tox.ini +++ b/modules/party_siret/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product/.drone.yml b/modules/product/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product/.flake8 b/modules/product/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product/doc/conf.py b/modules/product/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/product/doc/conf.py +++ b/modules/product/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product/setup.py b/modules/product/setup.py index ce5b623f12..2b8e10c914 100755 --- a/modules/product/setup.py +++ b/modules/product/setup.py @@ -42,23 +42,6 @@ name = 'trytond_product' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql', 'python-stdnum'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product/tox.ini b/modules/product/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product/tox.ini +++ b/modules/product/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_attribute/.drone.yml b/modules/product_attribute/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_attribute/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_attribute/.flake8 b/modules/product_attribute/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_attribute/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_attribute/doc/conf.py b/modules/product_attribute/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_attribute/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_attribute/setup.py b/modules/product_attribute/setup.py index 95966f13d7..26bec00cfe 100755 --- a/modules/product_attribute/setup.py +++ b/modules/product_attribute/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_attribute' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with product attributes', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_attribute/tox.ini b/modules/product_attribute/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_attribute/tox.ini +++ b/modules/product_attribute/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_classification/.drone.yml b/modules/product_classification/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_classification/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_classification/.flake8 b/modules/product_classification/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_classification/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_classification/doc/conf.py b/modules/product_classification/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_classification/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_classification/setup.py b/modules/product_classification/setup.py index 51d124e47e..815e88b2ba 100755 --- a/modules/product_classification/setup.py +++ b/modules/product_classification/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_classification' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to implement product classification', @@ -134,7 +111,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_classification/tox.ini b/modules/product_classification/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_classification/tox.ini +++ b/modules/product_classification/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_classification_taxonomic/.drone.yml b/modules/product_classification_taxonomic/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_classification_taxonomic/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_classification_taxonomic/.flake8 b/modules/product_classification_taxonomic/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_classification_taxonomic/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_classification_taxonomic/doc/conf.py b/modules/product_classification_taxonomic/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_classification_taxonomic/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_classification_taxonomic/setup.py b/modules/product_classification_taxonomic/setup.py index 40fb83c31b..07bfe8d99c 100755 --- a/modules/product_classification_taxonomic/setup.py +++ b/modules/product_classification_taxonomic/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_classification_taxonomic' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to implement product classification taxonomic', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_classification_taxonomic/tox.ini b/modules/product_classification_taxonomic/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_classification_taxonomic/tox.ini +++ b/modules/product_classification_taxonomic/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_cost_fifo/.drone.yml b/modules/product_cost_fifo/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_cost_fifo/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_cost_fifo/.flake8 b/modules/product_cost_fifo/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_cost_fifo/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_cost_fifo/doc/conf.py b/modules/product_cost_fifo/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_cost_fifo/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_cost_fifo/setup.py b/modules/product_cost_fifo/setup.py index 09ed8851e3..fd520e878b 100755 --- a/modules/product_cost_fifo/setup.py +++ b/modules/product_cost_fifo/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_cost_fifo' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_cost_fifo/tox.ini b/modules/product_cost_fifo/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_cost_fifo/tox.ini +++ b/modules/product_cost_fifo/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_cost_history/.drone.yml b/modules/product_cost_history/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_cost_history/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_cost_history/.flake8 b/modules/product_cost_history/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_cost_history/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_cost_history/doc/conf.py b/modules/product_cost_history/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_cost_history/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_cost_history/setup.py b/modules/product_cost_history/setup.py index da8e4c26ed..37c8ccc6ef 100755 --- a/modules/product_cost_history/setup.py +++ b/modules/product_cost_history/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_cost_history' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_cost_history/tox.ini b/modules/product_cost_history/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_cost_history/tox.ini +++ b/modules/product_cost_history/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_cost_warehouse/.drone.yml b/modules/product_cost_warehouse/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_cost_warehouse/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_cost_warehouse/.flake8 b/modules/product_cost_warehouse/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_cost_warehouse/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_cost_warehouse/doc/conf.py b/modules/product_cost_warehouse/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/product_cost_warehouse/doc/conf.py +++ b/modules/product_cost_warehouse/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_cost_warehouse/setup.py b/modules/product_cost_warehouse/setup.py index 0901bd745f..c17f8199ba 100755 --- a/modules/product_cost_warehouse/setup.py +++ b/modules/product_cost_warehouse/setup.py @@ -42,23 +42,6 @@ name = 'trytond_product_cost_warehouse' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -72,11 +55,6 @@ tests_require = [ get_require_version('trytond_product_cost_history'), get_require_version('trytond_account_stock_continental'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -147,7 +125,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_cost_warehouse/tox.ini b/modules/product_cost_warehouse/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_cost_warehouse/tox.ini +++ b/modules/product_cost_warehouse/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_kit/.drone.yml b/modules/product_kit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_kit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_kit/.flake8 b/modules/product_kit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_kit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_kit/doc/conf.py b/modules/product_kit/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/product_kit/doc/conf.py +++ b/modules/product_kit/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_kit/setup.py b/modules/product_kit/setup.py index c22ac1d7c9..f71e0fe371 100755 --- a/modules/product_kit/setup.py +++ b/modules/product_kit/setup.py @@ -42,23 +42,6 @@ name = 'trytond_product_kit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -75,11 +58,6 @@ tests_require = [ get_require_version('trytond_sale'), get_require_version('trytond_stock'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -150,7 +128,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_kit/tox.ini b/modules/product_kit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_kit/tox.ini +++ b/modules/product_kit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_measurements/.drone.yml b/modules/product_measurements/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_measurements/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_measurements/.flake8 b/modules/product_measurements/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_measurements/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_measurements/doc/conf.py b/modules/product_measurements/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_measurements/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_measurements/setup.py b/modules/product_measurements/setup.py index 620ee3c7de..240b0c9bff 100755 --- a/modules/product_measurements/setup.py +++ b/modules/product_measurements/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_measurements' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add measurements to product', @@ -137,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_measurements/tox.ini b/modules/product_measurements/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_measurements/tox.ini +++ b/modules/product_measurements/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_price_list/.drone.yml b/modules/product_price_list/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_price_list/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_price_list/.flake8 b/modules/product_price_list/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_price_list/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_price_list/doc/conf.py b/modules/product_price_list/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_price_list/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_price_list/setup.py b/modules/product_price_list/setup.py index cfe21cff4f..08a00de829 100755 --- a/modules/product_price_list/setup.py +++ b/modules/product_price_list/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_price_list' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['simpleeval', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with price list', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_price_list/tox.ini b/modules/product_price_list/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_price_list/tox.ini +++ b/modules/product_price_list/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_price_list_dates/.drone.yml b/modules/product_price_list_dates/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_price_list_dates/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_price_list_dates/.flake8 b/modules/product_price_list_dates/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_price_list_dates/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_price_list_dates/doc/conf.py b/modules/product_price_list_dates/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_price_list_dates/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_price_list_dates/setup.py b/modules/product_price_list_dates/setup.py index 6588f3dae0..273190da73 100755 --- a/modules/product_price_list_dates/setup.py +++ b/modules/product_price_list_dates/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_price_list_dates' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_sale_price_list')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_price_list_dates/tox.ini b/modules/product_price_list_dates/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_price_list_dates/tox.ini +++ b/modules/product_price_list_dates/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/product_price_list_parent/.drone.yml b/modules/product_price_list_parent/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/product_price_list_parent/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/product_price_list_parent/.flake8 b/modules/product_price_list_parent/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/product_price_list_parent/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/product_price_list_parent/doc/conf.py b/modules/product_price_list_parent/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/product_price_list_parent/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/product_price_list_parent/setup.py b/modules/product_price_list_parent/setup.py index 7316c3804d..13d3e788a5 100755 --- a/modules/product_price_list_parent/setup.py +++ b/modules/product_price_list_parent/setup.py @@ -39,23 +39,6 @@ name = 'trytond_product_price_list_parent' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/product_price_list_parent/tox.ini b/modules/product_price_list_parent/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/product_price_list_parent/tox.ini +++ b/modules/product_price_list_parent/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/production/.drone.yml b/modules/production/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/production/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/production/.flake8 b/modules/production/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/production/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/production/doc/conf.py b/modules/production/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/production/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/production/setup.py b/modules/production/setup.py index 160d1a6fd1..9e707283cb 100755 --- a/modules/production/setup.py +++ b/modules/production/setup.py @@ -39,23 +39,6 @@ name = 'trytond_production' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/production/tox.ini b/modules/production/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/production/tox.ini +++ b/modules/production/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/production_outsourcing/.drone.yml b/modules/production_outsourcing/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/production_outsourcing/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/production_outsourcing/.flake8 b/modules/production_outsourcing/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/production_outsourcing/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/production_outsourcing/doc/conf.py b/modules/production_outsourcing/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/production_outsourcing/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/production_outsourcing/setup.py b/modules/production_outsourcing/setup.py index 6f186fcefa..e139a6ae75 100755 --- a/modules/production_outsourcing/setup.py +++ b/modules/production_outsourcing/setup.py @@ -39,23 +39,6 @@ name = 'trytond_production_outsourcing' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/production_outsourcing/tox.ini b/modules/production_outsourcing/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/production_outsourcing/tox.ini +++ b/modules/production_outsourcing/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/production_routing/.drone.yml b/modules/production_routing/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/production_routing/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/production_routing/.flake8 b/modules/production_routing/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/production_routing/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/production_routing/doc/conf.py b/modules/production_routing/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/production_routing/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/production_routing/setup.py b/modules/production_routing/setup.py index 1669890ee8..221bc8a357 100755 --- a/modules/production_routing/setup.py +++ b/modules/production_routing/setup.py @@ -39,23 +39,6 @@ name = 'trytond_production_routing' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_stock_supply_production'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/production_routing/tox.ini b/modules/production_routing/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/production_routing/tox.ini +++ b/modules/production_routing/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/production_split/.drone.yml b/modules/production_split/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/production_split/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/production_split/.flake8 b/modules/production_split/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/production_split/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/production_split/doc/conf.py b/modules/production_split/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/production_split/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/production_split/setup.py b/modules/production_split/setup.py index c2af0eb856..b7d2dc227d 100755 --- a/modules/production_split/setup.py +++ b/modules/production_split/setup.py @@ -39,23 +39,6 @@ name = 'trytond_production_split' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/production_split/tox.ini b/modules/production_split/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/production_split/tox.ini +++ b/modules/production_split/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/production_work/.drone.yml b/modules/production_work/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/production_work/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/production_work/.flake8 b/modules/production_work/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/production_work/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/production_work/doc/conf.py b/modules/production_work/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/production_work/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/production_work/setup.py b/modules/production_work/setup.py index 330974cc40..2a5b63a54a 100755 --- a/modules/production_work/setup.py +++ b/modules/production_work/setup.py @@ -39,23 +39,6 @@ name = 'trytond_production_work' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/production_work/tox.ini b/modules/production_work/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/production_work/tox.ini +++ b/modules/production_work/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/production_work_timesheet/.drone.yml b/modules/production_work_timesheet/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/production_work_timesheet/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/production_work_timesheet/.flake8 b/modules/production_work_timesheet/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/production_work_timesheet/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/production_work_timesheet/doc/conf.py b/modules/production_work_timesheet/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/production_work_timesheet/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/production_work_timesheet/setup.py b/modules/production_work_timesheet/setup.py index 2edeaada5f..bbcfa81218 100755 --- a/modules/production_work_timesheet/setup.py +++ b/modules/production_work_timesheet/setup.py @@ -39,23 +39,6 @@ name = 'trytond_production_work_timesheet' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/production_work_timesheet/tox.ini b/modules/production_work_timesheet/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/production_work_timesheet/tox.ini +++ b/modules/production_work_timesheet/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/project/.drone.yml b/modules/project/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/project/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/project/.flake8 b/modules/project/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/project/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/project/setup.py b/modules/project/setup.py index 8cd41b8975..6c25d82b8e 100755 --- a/modules/project/setup.py +++ b/modules/project/setup.py @@ -39,23 +39,6 @@ name = 'trytond_project' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/project/tox.ini b/modules/project/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/project/tox.ini +++ b/modules/project/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/project_invoice/.drone.yml b/modules/project_invoice/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/project_invoice/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/project_invoice/.flake8 b/modules/project_invoice/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/project_invoice/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/project_invoice/doc/conf.py b/modules/project_invoice/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/project_invoice/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/project_invoice/setup.py b/modules/project_invoice/setup.py index 95c3bed572..050c26596c 100755 --- a/modules/project_invoice/setup.py +++ b/modules/project_invoice/setup.py @@ -39,23 +39,6 @@ name = 'trytond_project_invoice' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/project_invoice/tox.ini b/modules/project_invoice/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/project_invoice/tox.ini +++ b/modules/project_invoice/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/project_plan/.drone.yml b/modules/project_plan/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/project_plan/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/project_plan/.flake8 b/modules/project_plan/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/project_plan/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/project_plan/doc/conf.py b/modules/project_plan/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/project_plan/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/project_plan/setup.py b/modules/project_plan/setup.py index 4e7090722c..7da10ba9fb 100755 --- a/modules/project_plan/setup.py +++ b/modules/project_plan/setup.py @@ -39,23 +39,6 @@ name = 'trytond_project_plan' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add planning capabilities on projects', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/project_plan/tox.ini b/modules/project_plan/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/project_plan/tox.ini +++ b/modules/project_plan/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/project_revenue/.drone.yml b/modules/project_revenue/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/project_revenue/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/project_revenue/.flake8 b/modules/project_revenue/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/project_revenue/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/project_revenue/doc/conf.py b/modules/project_revenue/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/project_revenue/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/project_revenue/setup.py b/modules/project_revenue/setup.py index 45ac357638..b878afa5c6 100755 --- a/modules/project_revenue/setup.py +++ b/modules/project_revenue/setup.py @@ -39,23 +39,6 @@ name = 'trytond_project_revenue' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_purchase')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/project_revenue/tox.ini b/modules/project_revenue/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/project_revenue/tox.ini +++ b/modules/project_revenue/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase/.drone.yml b/modules/purchase/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase/.flake8 b/modules/purchase/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase/doc/conf.py b/modules/purchase/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/purchase/doc/conf.py +++ b/modules/purchase/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase/setup.py b/modules/purchase/setup.py index 6522e2c412..3931e17656 100755 --- a/modules/purchase/setup.py +++ b/modules/purchase/setup.py @@ -42,23 +42,6 @@ name = 'trytond_purchase' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase/tox.ini b/modules/purchase/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase/tox.ini +++ b/modules/purchase/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_amendment/.drone.yml b/modules/purchase_amendment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_amendment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_amendment/.flake8 b/modules/purchase_amendment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_amendment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_amendment/doc/conf.py b/modules/purchase_amendment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_amendment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_amendment/setup.py b/modules/purchase_amendment/setup.py index 3cfac42433..ce7472bd74 100755 --- a/modules/purchase_amendment/setup.py +++ b/modules/purchase_amendment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_amendment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_amendment/tox.ini b/modules/purchase_amendment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_amendment/tox.ini +++ b/modules/purchase_amendment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_history/.drone.yml b/modules/purchase_history/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_history/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_history/.flake8 b/modules/purchase_history/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_history/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_history/doc/conf.py b/modules/purchase_history/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_history/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_history/setup.py b/modules/purchase_history/setup.py index aed3a94c56..12bef5f8a2 100755 --- a/modules/purchase_history/setup.py +++ b/modules/purchase_history/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_history' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -135,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_history/tox.ini b/modules/purchase_history/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_history/tox.ini +++ b/modules/purchase_history/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_invoice_line_standalone/.drone.yml b/modules/purchase_invoice_line_standalone/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_invoice_line_standalone/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_invoice_line_standalone/.flake8 b/modules/purchase_invoice_line_standalone/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_invoice_line_standalone/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_invoice_line_standalone/doc/conf.py b/modules/purchase_invoice_line_standalone/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_invoice_line_standalone/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_invoice_line_standalone/setup.py b/modules/purchase_invoice_line_standalone/setup.py index b11c587ece..d2bc9f6b21 100755 --- a/modules/purchase_invoice_line_standalone/setup.py +++ b/modules/purchase_invoice_line_standalone/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_invoice_line_standalone' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_invoice_line_standalone/tox.ini b/modules/purchase_invoice_line_standalone/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_invoice_line_standalone/tox.ini +++ b/modules/purchase_invoice_line_standalone/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_price_list/.drone.yml b/modules/purchase_price_list/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_price_list/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_price_list/.flake8 b/modules/purchase_price_list/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_price_list/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_price_list/doc/conf.py b/modules/purchase_price_list/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/purchase_price_list/doc/conf.py +++ b/modules/purchase_price_list/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_price_list/setup.py b/modules/purchase_price_list/setup.py index 6d4d61654f..268667fa27 100755 --- a/modules/purchase_price_list/setup.py +++ b/modules/purchase_price_list/setup.py @@ -42,24 +42,7 @@ name = 'trytond_purchase_price_list' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): @@ -67,12 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version) - ) setup(name=name, version=version, @@ -143,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_price_list/tox.ini b/modules/purchase_price_list/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_price_list/tox.ini +++ b/modules/purchase_price_list/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_request/.drone.yml b/modules/purchase_request/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_request/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_request/.flake8 b/modules/purchase_request/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_request/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_request/doc/conf.py b/modules/purchase_request/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_request/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_request/setup.py b/modules/purchase_request/setup.py index 0b15ae58ea..1ff6a674c4 100755 --- a/modules/purchase_request/setup.py +++ b/modules/purchase_request/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_request' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_stock_supply'), get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_request/tox.ini b/modules/purchase_request/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_request/tox.ini +++ b/modules/purchase_request/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_request_quotation/.drone.yml b/modules/purchase_request_quotation/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_request_quotation/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_request_quotation/.flake8 b/modules/purchase_request_quotation/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_request_quotation/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_request_quotation/doc/conf.py b/modules/purchase_request_quotation/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_request_quotation/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_request_quotation/setup.py b/modules/purchase_request_quotation/setup.py index a422de7aaa..52985395d1 100755 --- a/modules/purchase_request_quotation/setup.py +++ b/modules/purchase_request_quotation/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_request_quotation' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_purchase_requisition'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_request_quotation/tox.ini b/modules/purchase_request_quotation/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_request_quotation/tox.ini +++ b/modules/purchase_request_quotation/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_requisition/.drone.yml b/modules/purchase_requisition/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_requisition/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_requisition/.flake8 b/modules/purchase_requisition/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_requisition/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_requisition/doc/conf.py b/modules/purchase_requisition/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_requisition/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_requisition/setup.py b/modules/purchase_requisition/setup.py index 2bb1ff02ab..bdeb00e0e9 100755 --- a/modules/purchase_requisition/setup.py +++ b/modules/purchase_requisition/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_requisition' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_requisition/tox.ini b/modules/purchase_requisition/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_requisition/tox.ini +++ b/modules/purchase_requisition/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_secondary_unit/.drone.yml b/modules/purchase_secondary_unit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_secondary_unit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_secondary_unit/.flake8 b/modules/purchase_secondary_unit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_secondary_unit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_secondary_unit/doc/conf.py b/modules/purchase_secondary_unit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_secondary_unit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_secondary_unit/setup.py b/modules/purchase_secondary_unit/setup.py index a640d703fb..87c1e42991 100755 --- a/modules/purchase_secondary_unit/setup.py +++ b/modules/purchase_secondary_unit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_secondary_unit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_account_invoice_secondary_unit'), get_require_version('trytond_stock_secondary_unit')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_secondary_unit/tox.ini b/modules/purchase_secondary_unit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_secondary_unit/tox.ini +++ b/modules/purchase_secondary_unit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/purchase_shipment_cost/.drone.yml b/modules/purchase_shipment_cost/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/purchase_shipment_cost/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/purchase_shipment_cost/.flake8 b/modules/purchase_shipment_cost/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/purchase_shipment_cost/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/purchase_shipment_cost/doc/conf.py b/modules/purchase_shipment_cost/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/purchase_shipment_cost/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/purchase_shipment_cost/setup.py b/modules/purchase_shipment_cost/setup.py index da83f21a73..7cb2ae3bd2 100755 --- a/modules/purchase_shipment_cost/setup.py +++ b/modules/purchase_shipment_cost/setup.py @@ -39,23 +39,6 @@ name = 'trytond_purchase_shipment_cost' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,21 +46,11 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -extras_require = {} -for dep in info.get('extras_depend', []): - if not re.match(r'(ir|res)(\W|$)', dep): - extras_require[dep] = get_require_version('trytond_%s' % dep) - tests_require = [get_require_version('proteus'), get_require_version('trytond_account_invoice_stock'), get_require_version('trytond_account_stock_continental'), get_require_version('trytond_account_stock_anglo_saxon'), get_require_version('trytond_purchase')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -147,8 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - extras_require=extras_require, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/purchase_shipment_cost/tox.ini b/modules/purchase_shipment_cost/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/purchase_shipment_cost/tox.ini +++ b/modules/purchase_shipment_cost/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale/.drone.yml b/modules/sale/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale/.flake8 b/modules/sale/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale/doc/conf.py b/modules/sale/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/sale/doc/conf.py +++ b/modules/sale/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale/setup.py b/modules/sale/setup.py index bff76c956b..d3e4071e32 100755 --- a/modules/sale/setup.py +++ b/modules/sale/setup.py @@ -42,23 +42,6 @@ name = 'trytond_sale' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4', 'python-dateutil'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -144,7 +122,6 @@ setup(name=name, extras_require={ 'sparklines': ['pygal'], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale/tox.ini b/modules/sale/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale/tox.ini +++ b/modules/sale/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_advance_payment/.drone.yml b/modules/sale_advance_payment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_advance_payment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_advance_payment/.flake8 b/modules/sale_advance_payment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_advance_payment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_advance_payment/doc/conf.py b/modules/sale_advance_payment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_advance_payment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_advance_payment/setup.py b/modules/sale_advance_payment/setup.py index eceecbbc1b..fa25cacad5 100755 --- a/modules/sale_advance_payment/setup.py +++ b/modules/sale_advance_payment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_advance_payment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['simpleeval'] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for dep in ['sale_supply']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_advance_payment/tox.ini b/modules/sale_advance_payment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_advance_payment/tox.ini +++ b/modules/sale_advance_payment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_amendment/.drone.yml b/modules/sale_amendment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_amendment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_amendment/.flake8 b/modules/sale_amendment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_amendment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_amendment/doc/conf.py b/modules/sale_amendment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_amendment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_amendment/setup.py b/modules/sale_amendment/setup.py index 7e5557eb7c..7931e5bb8b 100755 --- a/modules/sale_amendment/setup.py +++ b/modules/sale_amendment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_amendment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_amendment/tox.ini b/modules/sale_amendment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_amendment/tox.ini +++ b/modules/sale_amendment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_complaint/.drone.yml b/modules/sale_complaint/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_complaint/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_complaint/.flake8 b/modules/sale_complaint/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_complaint/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_complaint/doc/conf.py b/modules/sale_complaint/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_complaint/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_complaint/setup.py b/modules/sale_complaint/setup.py index ded0dc9ab9..aa49f8e38a 100755 --- a/modules/sale_complaint/setup.py +++ b/modules/sale_complaint/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_complaint' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_complaint/tox.ini b/modules/sale_complaint/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_complaint/tox.ini +++ b/modules/sale_complaint/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_credit_limit/.drone.yml b/modules/sale_credit_limit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_credit_limit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_credit_limit/.flake8 b/modules/sale_credit_limit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_credit_limit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_credit_limit/doc/conf.py b/modules/sale_credit_limit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_credit_limit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_credit_limit/setup.py b/modules/sale_credit_limit/setup.py index fcae5e0be1..15ffe2ae54 100755 --- a/modules/sale_credit_limit/setup.py +++ b/modules/sale_credit_limit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_credit_limit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module for sale credit limit', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_credit_limit/tox.ini b/modules/sale_credit_limit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_credit_limit/tox.ini +++ b/modules/sale_credit_limit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_discount/.drone.yml b/modules/sale_discount/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_discount/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_discount/.flake8 b/modules/sale_discount/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_discount/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_discount/doc/conf.py b/modules/sale_discount/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_discount/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_discount/setup.py b/modules/sale_discount/setup.py index 60c1ff46d7..785d83f949 100755 --- a/modules/sale_discount/setup.py +++ b/modules/sale_discount/setup.py @@ -42,23 +42,6 @@ name = 'trytond_sale_discount' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_discount/tox.ini b/modules/sale_discount/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_discount/tox.ini +++ b/modules/sale_discount/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_extra/.drone.yml b/modules/sale_extra/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_extra/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_extra/.flake8 b/modules/sale_extra/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_extra/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_extra/doc/conf.py b/modules/sale_extra/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_extra/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_extra/setup.py b/modules/sale_extra/setup.py index c0fafb2938..a23df2fa37 100755 --- a/modules/sale_extra/setup.py +++ b/modules/sale_extra/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_extra' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_extra/tox.ini b/modules/sale_extra/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_extra/tox.ini +++ b/modules/sale_extra/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_gift_card/.drone.yml b/modules/sale_gift_card/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_gift_card/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_gift_card/.flake8 b/modules/sale_gift_card/.flake8 deleted file mode 100644 index bb03d08a82..0000000000 --- a/modules/sale_gift_card/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,W503 diff --git a/modules/sale_gift_card/doc/conf.py b/modules/sale_gift_card/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/sale_gift_card/doc/conf.py +++ b/modules/sale_gift_card/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_gift_card/setup.py b/modules/sale_gift_card/setup.py index 1172bb1315..b1b42be98f 100755 --- a/modules/sale_gift_card/setup.py +++ b/modules/sale_gift_card/setup.py @@ -42,23 +42,6 @@ name = 'trytond_sale_gift_card' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_gift_card/tox.ini b/modules/sale_gift_card/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_gift_card/tox.ini +++ b/modules/sale_gift_card/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_history/.drone.yml b/modules/sale_history/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_history/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_history/.flake8 b/modules/sale_history/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_history/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_history/doc/conf.py b/modules/sale_history/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_history/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_history/setup.py b/modules/sale_history/setup.py index 18baf25e0c..ed36311af6 100755 --- a/modules/sale_history/setup.py +++ b/modules/sale_history/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_history' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -135,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_history/tox.ini b/modules/sale_history/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_history/tox.ini +++ b/modules/sale_history/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_invoice_grouping/.drone.yml b/modules/sale_invoice_grouping/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_invoice_grouping/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_invoice_grouping/.flake8 b/modules/sale_invoice_grouping/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_invoice_grouping/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_invoice_grouping/doc/conf.py b/modules/sale_invoice_grouping/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_invoice_grouping/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_invoice_grouping/setup.py b/modules/sale_invoice_grouping/setup.py index 9eac5b3a02..ab2289a164 100755 --- a/modules/sale_invoice_grouping/setup.py +++ b/modules/sale_invoice_grouping/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_invoice_grouping' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_invoice_grouping/tox.ini b/modules/sale_invoice_grouping/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_invoice_grouping/tox.ini +++ b/modules/sale_invoice_grouping/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_opportunity/.drone.yml b/modules/sale_opportunity/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_opportunity/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_opportunity/.flake8 b/modules/sale_opportunity/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_opportunity/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_opportunity/doc/conf.py b/modules/sale_opportunity/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_opportunity/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_opportunity/setup.py b/modules/sale_opportunity/setup.py index 296c57bcd4..9bb9ec93f8 100755 --- a/modules/sale_opportunity/setup.py +++ b/modules/sale_opportunity/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_opportunity' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_opportunity/tox.ini b/modules/sale_opportunity/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_opportunity/tox.ini +++ b/modules/sale_opportunity/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_payment/.drone.yml b/modules/sale_payment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_payment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_payment/.flake8 b/modules/sale_payment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_payment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_payment/doc/conf.py b/modules/sale_payment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_payment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_payment/setup.py b/modules/sale_payment/setup.py index dadc6af054..772c78154b 100755 --- a/modules/sale_payment/setup.py +++ b/modules/sale_payment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_payment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for dep in ['account_payment_clearing']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_payment/tox.ini b/modules/sale_payment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_payment/tox.ini +++ b/modules/sale_payment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_price_list/.drone.yml b/modules/sale_price_list/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_price_list/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_price_list/.flake8 b/modules/sale_price_list/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_price_list/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_price_list/doc/conf.py b/modules/sale_price_list/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_price_list/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_price_list/setup.py b/modules/sale_price_list/setup.py index 9f61b67ac6..060dae6bff 100755 --- a/modules/sale_price_list/setup.py +++ b/modules/sale_price_list/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_price_list' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,11 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_price_list/tox.ini b/modules/sale_price_list/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_price_list/tox.ini +++ b/modules/sale_price_list/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_product_customer/.drone.yml b/modules/sale_product_customer/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_product_customer/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_product_customer/.flake8 b/modules/sale_product_customer/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_product_customer/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_product_customer/doc/conf.py b/modules/sale_product_customer/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_product_customer/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_product_customer/setup.py b/modules/sale_product_customer/setup.py index be25abe7b9..39d65c68e3 100755 --- a/modules/sale_product_customer/setup.py +++ b/modules/sale_product_customer/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_product_customer' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_sale_amendment')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_product_customer/tox.ini b/modules/sale_product_customer/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_product_customer/tox.ini +++ b/modules/sale_product_customer/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_promotion/.drone.yml b/modules/sale_promotion/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_promotion/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_promotion/.flake8 b/modules/sale_promotion/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_promotion/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_promotion/doc/conf.py b/modules/sale_promotion/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_promotion/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_promotion/setup.py b/modules/sale_promotion/setup.py index 914f9d039a..7ed1903156 100755 --- a/modules/sale_promotion/setup.py +++ b/modules/sale_promotion/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_promotion' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['simpleeval'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_promotion/tox.ini b/modules/sale_promotion/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_promotion/tox.ini +++ b/modules/sale_promotion/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_promotion_coupon/.drone.yml b/modules/sale_promotion_coupon/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_promotion_coupon/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_promotion_coupon/.flake8 b/modules/sale_promotion_coupon/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_promotion_coupon/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_promotion_coupon/doc/conf.py b/modules/sale_promotion_coupon/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_promotion_coupon/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_promotion_coupon/setup.py b/modules/sale_promotion_coupon/setup.py index feb6b805b8..15b937dd41 100755 --- a/modules/sale_promotion_coupon/setup.py +++ b/modules/sale_promotion_coupon/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_promotion_coupon' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_promotion_coupon/tox.ini b/modules/sale_promotion_coupon/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_promotion_coupon/tox.ini +++ b/modules/sale_promotion_coupon/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_secondary_unit/.drone.yml b/modules/sale_secondary_unit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_secondary_unit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_secondary_unit/.flake8 b/modules/sale_secondary_unit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_secondary_unit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_secondary_unit/doc/conf.py b/modules/sale_secondary_unit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_secondary_unit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_secondary_unit/setup.py b/modules/sale_secondary_unit/setup.py index 71ac91e766..5930417c65 100755 --- a/modules/sale_secondary_unit/setup.py +++ b/modules/sale_secondary_unit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_secondary_unit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [get_require_version('proteus'), get_require_version('trytond_account_invoice_secondary_unit'), get_require_version('trytond_stock_secondary_unit'), get_require_version('trytond_sale_product_customer')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_secondary_unit/tox.ini b/modules/sale_secondary_unit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_secondary_unit/tox.ini +++ b/modules/sale_secondary_unit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_shipment_cost/.drone.yml b/modules/sale_shipment_cost/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_shipment_cost/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_shipment_cost/.flake8 b/modules/sale_shipment_cost/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_shipment_cost/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_shipment_cost/doc/conf.py b/modules/sale_shipment_cost/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_shipment_cost/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_shipment_cost/setup.py b/modules/sale_shipment_cost/setup.py index 156291259f..ad1f1a1701 100755 --- a/modules/sale_shipment_cost/setup.py +++ b/modules/sale_shipment_cost/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_shipment_cost' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -69,11 +52,6 @@ tests_require = [ ] for dep in ['account', 'party', 'stock', 'sale_promotion']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -145,7 +123,6 @@ setup(name=name, install_requires=requires, extras_require={ }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_shipment_cost/tox.ini b/modules/sale_shipment_cost/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_shipment_cost/tox.ini +++ b/modules/sale_shipment_cost/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_shipment_grouping/.drone.yml b/modules/sale_shipment_grouping/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_shipment_grouping/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_shipment_grouping/.flake8 b/modules/sale_shipment_grouping/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_shipment_grouping/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_shipment_grouping/doc/conf.py b/modules/sale_shipment_grouping/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_shipment_grouping/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_shipment_grouping/setup.py b/modules/sale_shipment_grouping/setup.py index f9b4d3e82e..fa1fe3a575 100755 --- a/modules/sale_shipment_grouping/setup.py +++ b/modules/sale_shipment_grouping/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_shipment_grouping' download_url = 'http://dowloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_shipment_grouping/tox.ini b/modules/sale_shipment_grouping/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_shipment_grouping/tox.ini +++ b/modules/sale_shipment_grouping/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_shipment_tolerance/.drone.yml b/modules/sale_shipment_tolerance/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_shipment_tolerance/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_shipment_tolerance/.flake8 b/modules/sale_shipment_tolerance/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_shipment_tolerance/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_shipment_tolerance/doc/conf.py b/modules/sale_shipment_tolerance/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_shipment_tolerance/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_shipment_tolerance/setup.py b/modules/sale_shipment_tolerance/setup.py index f62055ed4e..511fea93e9 100755 --- a/modules/sale_shipment_tolerance/setup.py +++ b/modules/sale_shipment_tolerance/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_shipment_tolerance' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_shipment_tolerance/tox.ini b/modules/sale_shipment_tolerance/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_shipment_tolerance/tox.ini +++ b/modules/sale_shipment_tolerance/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_stock_quantity/.drone.yml b/modules/sale_stock_quantity/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_stock_quantity/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_stock_quantity/.flake8 b/modules/sale_stock_quantity/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_stock_quantity/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_stock_quantity/doc/conf.py b/modules/sale_stock_quantity/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_stock_quantity/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_stock_quantity/setup.py b/modules/sale_stock_quantity/setup.py index 86bb7f5efd..bac614014a 100755 --- a/modules/sale_stock_quantity/setup.py +++ b/modules/sale_stock_quantity/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_stock_quantity' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_stock_supply'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_stock_quantity/tox.ini b/modules/sale_stock_quantity/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_stock_quantity/tox.ini +++ b/modules/sale_stock_quantity/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_subscription/.drone.yml b/modules/sale_subscription/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_subscription/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_subscription/.flake8 b/modules/sale_subscription/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_subscription/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_subscription/doc/conf.py b/modules/sale_subscription/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_subscription/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_subscription/setup.py b/modules/sale_subscription/setup.py index 93ea4d00dd..fd7d0344a5 100755 --- a/modules/sale_subscription/setup.py +++ b/modules/sale_subscription/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_subscription' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-dateutil'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_subscription/tox.ini b/modules/sale_subscription/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_subscription/tox.ini +++ b/modules/sale_subscription/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_subscription_asset/.drone.yml b/modules/sale_subscription_asset/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_subscription_asset/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_subscription_asset/.flake8 b/modules/sale_subscription_asset/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_subscription_asset/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_subscription_asset/doc/conf.py b/modules/sale_subscription_asset/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_subscription_asset/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_subscription_asset/setup.py b/modules/sale_subscription_asset/setup.py index c14fc14ffc..38bee7da47 100755 --- a/modules/sale_subscription_asset/setup.py +++ b/modules/sale_subscription_asset/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_subscription_asset' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_subscription_asset/tox.ini b/modules/sale_subscription_asset/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_subscription_asset/tox.ini +++ b/modules/sale_subscription_asset/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_supply/.drone.yml b/modules/sale_supply/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_supply/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_supply/.flake8 b/modules/sale_supply/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_supply/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_supply/doc/conf.py b/modules/sale_supply/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_supply/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_supply/setup.py b/modules/sale_supply/setup.py index ae82a40eec..5fb37c209c 100755 --- a/modules/sale_supply/setup.py +++ b/modules/sale_supply/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_supply' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_supply/tox.ini b/modules/sale_supply/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_supply/tox.ini +++ b/modules/sale_supply/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_supply_drop_shipment/.drone.yml b/modules/sale_supply_drop_shipment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_supply_drop_shipment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_supply_drop_shipment/.flake8 b/modules/sale_supply_drop_shipment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_supply_drop_shipment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_supply_drop_shipment/doc/conf.py b/modules/sale_supply_drop_shipment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_supply_drop_shipment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_supply_drop_shipment/setup.py b/modules/sale_supply_drop_shipment/setup.py index cbf750f910..719edf5b00 100755 --- a/modules/sale_supply_drop_shipment/setup.py +++ b/modules/sale_supply_drop_shipment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_sale_supply_drop_shipment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_supply_drop_shipment/tox.ini b/modules/sale_supply_drop_shipment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_supply_drop_shipment/tox.ini +++ b/modules/sale_supply_drop_shipment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/sale_supply_production/.drone.yml b/modules/sale_supply_production/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/sale_supply_production/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/sale_supply_production/.flake8 b/modules/sale_supply_production/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/sale_supply_production/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/sale_supply_production/doc/conf.py b/modules/sale_supply_production/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/sale_supply_production/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/sale_supply_production/setup.py b/modules/sale_supply_production/setup.py index 499d01840e..217a81d0f8 100755 --- a/modules/sale_supply_production/setup.py +++ b/modules/sale_supply_production/setup.py @@ -42,23 +42,6 @@ name = 'trytond_sale_supply_production' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/sale_supply_production/tox.ini b/modules/sale_supply_production/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/sale_supply_production/tox.ini +++ b/modules/sale_supply_production/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock/.drone.yml b/modules/stock/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock/.flake8 b/modules/stock/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock/doc/conf.py b/modules/stock/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/stock/doc/conf.py +++ b/modules/stock/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock/setup.py b/modules/stock/setup.py index 83e8536d39..ee1db92fda 100755 --- a/modules/stock/setup.py +++ b/modules/stock/setup.py @@ -42,23 +42,6 @@ name = 'trytond_stock' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 1.3.0', 'simpleeval'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -144,7 +122,6 @@ setup(name=name, extras_require={ 'sparklines': ['pygal'], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock/tox.ini b/modules/stock/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock/tox.ini +++ b/modules/stock/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_assign_manual/.drone.yml b/modules/stock_assign_manual/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_assign_manual/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_assign_manual/.flake8 b/modules/stock_assign_manual/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_assign_manual/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_assign_manual/doc/conf.py b/modules/stock_assign_manual/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_assign_manual/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_assign_manual/setup.py b/modules/stock_assign_manual/setup.py index cdbe59edaa..fd73ea240d 100755 --- a/modules/stock_assign_manual/setup.py +++ b/modules/stock_assign_manual/setup.py @@ -42,23 +42,6 @@ name = 'trytond_stock_assign_manual' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -70,11 +53,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_production'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -144,7 +122,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_assign_manual/tox.ini b/modules/stock_assign_manual/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_assign_manual/tox.ini +++ b/modules/stock_assign_manual/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_consignment/.drone.yml b/modules/stock_consignment/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_consignment/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_consignment/.flake8 b/modules/stock_consignment/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_consignment/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_consignment/doc/conf.py b/modules/stock_consignment/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_consignment/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_consignment/setup.py b/modules/stock_consignment/setup.py index 379cc718bc..cc2a009344 100755 --- a/modules/stock_consignment/setup.py +++ b/modules/stock_consignment/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_consignment' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_stock_supply')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_consignment/tox.ini b/modules/stock_consignment/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_consignment/tox.ini +++ b/modules/stock_consignment/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_forecast/.drone.yml b/modules/stock_forecast/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_forecast/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_forecast/.flake8 b/modules/stock_forecast/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_forecast/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_forecast/doc/conf.py b/modules/stock_forecast/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_forecast/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_forecast/setup.py b/modules/stock_forecast/setup.py index e412fff793..bd400cc27e 100755 --- a/modules/stock_forecast/setup.py +++ b/modules/stock_forecast/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_forecast' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-dateutil', 'python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with stock forecasts', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_forecast/tox.ini b/modules/stock_forecast/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_forecast/tox.ini +++ b/modules/stock_forecast/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_inventory_location/.drone.yml b/modules/stock_inventory_location/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_inventory_location/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_inventory_location/.flake8 b/modules/stock_inventory_location/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_inventory_location/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_inventory_location/doc/conf.py b/modules/stock_inventory_location/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_inventory_location/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_inventory_location/setup.py b/modules/stock_inventory_location/setup.py index ad5401ae03..ad67a3bddc 100755 --- a/modules/stock_inventory_location/setup.py +++ b/modules/stock_inventory_location/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_inventory_location' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -139,7 +117,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_inventory_location/tox.ini b/modules/stock_inventory_location/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_inventory_location/tox.ini +++ b/modules/stock_inventory_location/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_location_move/.drone.yml b/modules/stock_location_move/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_location_move/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_location_move/.flake8 b/modules/stock_location_move/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_location_move/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_location_move/doc/conf.py b/modules/stock_location_move/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_location_move/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_location_move/setup.py b/modules/stock_location_move/setup.py index 6b4be19eee..9a5b49e87e 100755 --- a/modules/stock_location_move/setup.py +++ b/modules/stock_location_move/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_location_move' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for dep in info.get('extras_depend', []): tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_location_move/tox.ini b/modules/stock_location_move/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_location_move/tox.ini +++ b/modules/stock_location_move/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_location_sequence/.drone.yml b/modules/stock_location_sequence/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_location_sequence/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_location_sequence/.flake8 b/modules/stock_location_sequence/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_location_sequence/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_location_sequence/doc/conf.py b/modules/stock_location_sequence/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_location_sequence/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_location_sequence/setup.py b/modules/stock_location_sequence/setup.py index e9e556dec4..d4ce1960f1 100755 --- a/modules/stock_location_sequence/setup.py +++ b/modules/stock_location_sequence/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_location_sequence' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add sequence on location', @@ -137,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_location_sequence/tox.ini b/modules/stock_location_sequence/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_location_sequence/tox.ini +++ b/modules/stock_location_sequence/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_lot/.drone.yml b/modules/stock_lot/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_lot/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_lot/.flake8 b/modules/stock_lot/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_lot/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_lot/doc/conf.py b/modules/stock_lot/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_lot/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_lot/setup.py b/modules/stock_lot/setup.py index 635b13b730..a942074bec 100755 --- a/modules/stock_lot/setup.py +++ b/modules/stock_lot/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_lot' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), 'python-dateutil'] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_lot/tox.ini b/modules/stock_lot/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_lot/tox.ini +++ b/modules/stock_lot/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_lot_sled/.drone.yml b/modules/stock_lot_sled/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_lot_sled/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_lot_sled/.flake8 b/modules/stock_lot_sled/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_lot_sled/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_lot_sled/doc/conf.py b/modules/stock_lot_sled/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_lot_sled/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_lot_sled/setup.py b/modules/stock_lot_sled/setup.py index b68c550862..9115a7c4bf 100755 --- a/modules/stock_lot_sled/setup.py +++ b/modules/stock_lot_sled/setup.py @@ -39,35 +39,14 @@ name = 'trytond_stock_lot_sled' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.5'] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) + tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_lot_sled/tox.ini b/modules/stock_lot_sled/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_lot_sled/tox.ini +++ b/modules/stock_lot_sled/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_lot_unit/.drone.yml b/modules/stock_lot_unit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_lot_unit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_lot_unit/.flake8 b/modules/stock_lot_unit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_lot_unit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_lot_unit/doc/conf.py b/modules/stock_lot_unit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_lot_unit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_lot_unit/setup.py b/modules/stock_lot_unit/setup.py index 244d7a51af..a99f4fce12 100755 --- a/modules/stock_lot_unit/setup.py +++ b/modules/stock_lot_unit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_lot_unit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -65,11 +48,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus'), get_require_version('trytond_production')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_lot_unit/tox.ini b/modules/stock_lot_unit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_lot_unit/tox.ini +++ b/modules/stock_lot_unit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_package/.drone.yml b/modules/stock_package/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_package/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_package/.flake8 b/modules/stock_package/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_package/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_package/doc/conf.py b/modules/stock_package/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_package/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_package/setup.py b/modules/stock_package/setup.py index 8fafb4f580..24a695c1c7 100755 --- a/modules/stock_package/setup.py +++ b/modules/stock_package/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_package' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_package/tox.ini b/modules/stock_package/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_package/tox.ini +++ b/modules/stock_package/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_package_shipping/.drone.yml b/modules/stock_package_shipping/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_package_shipping/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_package_shipping/.flake8 b/modules/stock_package_shipping/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_package_shipping/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_package_shipping/doc/conf.py b/modules/stock_package_shipping/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/stock_package_shipping/doc/conf.py +++ b/modules/stock_package_shipping/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_package_shipping/setup.py b/modules/stock_package_shipping/setup.py index e3af19639d..559fdf2c32 100755 --- a/modules/stock_package_shipping/setup.py +++ b/modules/stock_package_shipping/setup.py @@ -42,23 +42,6 @@ name = 'trytond_stock_package_shipping' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -141,7 +119,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_package_shipping/tox.ini b/modules/stock_package_shipping/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_package_shipping/tox.ini +++ b/modules/stock_package_shipping/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_package_shipping_dpd/.drone.yml b/modules/stock_package_shipping_dpd/.drone.yml deleted file mode 100644 index bd59ee26f9..0000000000 --- a/modules/stock_package_shipping_dpd/.drone.yml +++ /dev/null @@ -1,69 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID DPD_USER_ID DPD_PASSWORD - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - secrets: [ dpd_user_id, dpd_password ] - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_package_shipping_dpd/.flake8 b/modules/stock_package_shipping_dpd/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_package_shipping_dpd/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_package_shipping_dpd/doc/conf.py b/modules/stock_package_shipping_dpd/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_package_shipping_dpd/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_package_shipping_dpd/setup.py b/modules/stock_package_shipping_dpd/setup.py index 36056ae664..e4c36399ea 100755 --- a/modules/stock_package_shipping_dpd/setup.py +++ b/modules/stock_package_shipping_dpd/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_package_shipping_dpd' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['zeep >= 0.12', 'PyPDF2'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_package_shipping_dpd/tox.ini b/modules/stock_package_shipping_dpd/tox.ini index c3d6d4a4d0..38c7d407f5 100644 --- a/modules/stock_package_shipping_dpd/tox.ini +++ b/modules/stock_package_shipping_dpd/tox.ini @@ -7,10 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -passenv=DPD_USER_ID DPD_PASSWORD -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_package_shipping_ups/.drone.yml b/modules/stock_package_shipping_ups/.drone.yml deleted file mode 100644 index 9a716a214b..0000000000 --- a/modules/stock_package_shipping_ups/.drone.yml +++ /dev/null @@ -1,69 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID UPS_USER_ID UPS_PASSWORD UPS_LICENSE UPS_ACCOUNT_NUMBER - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - secrets: [ ups_user_id, ups_password, ups_account_number, ups_license ] - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_package_shipping_ups/.flake8 b/modules/stock_package_shipping_ups/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_package_shipping_ups/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_package_shipping_ups/doc/conf.py b/modules/stock_package_shipping_ups/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_package_shipping_ups/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_package_shipping_ups/setup.py b/modules/stock_package_shipping_ups/setup.py index d6b7e5381f..a65d100f33 100755 --- a/modules/stock_package_shipping_ups/setup.py +++ b/modules/stock_package_shipping_ups/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_package_shipping_ups' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['requests'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_package_shipping_ups/tox.ini b/modules/stock_package_shipping_ups/tox.ini index b57995c8c1..38c7d407f5 100644 --- a/modules/stock_package_shipping_ups/tox.ini +++ b/modules/stock_package_shipping_ups/tox.ini @@ -7,10 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -passenv = UPS_USER_ID UPS_PASSWORD UPS_ACCOUNT_NUMBER UPS_LICENSE -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_product_location/.drone.yml b/modules/stock_product_location/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_product_location/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_product_location/.flake8 b/modules/stock_product_location/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_product_location/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_product_location/doc/conf.py b/modules/stock_product_location/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_product_location/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_product_location/setup.py b/modules/stock_product_location/setup.py index b4e9833695..89f4ee272d 100755 --- a/modules/stock_product_location/setup.py +++ b/modules/stock_product_location/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_product_location' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -66,11 +49,6 @@ requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] for dep in ['production']: tests_require.append(get_require_version('trytond_%s' % dep)) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_product_location/tox.ini b/modules/stock_product_location/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_product_location/tox.ini +++ b/modules/stock_product_location/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_quantity_early_planning/.drone.yml b/modules/stock_quantity_early_planning/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_quantity_early_planning/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_quantity_early_planning/.flake8 b/modules/stock_quantity_early_planning/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_quantity_early_planning/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_quantity_early_planning/doc/conf.py b/modules/stock_quantity_early_planning/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/stock_quantity_early_planning/doc/conf.py +++ b/modules/stock_quantity_early_planning/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_quantity_early_planning/setup.py b/modules/stock_quantity_early_planning/setup.py index 0eb4e49274..1bccb6153d 100755 --- a/modules/stock_quantity_early_planning/setup.py +++ b/modules/stock_quantity_early_planning/setup.py @@ -42,24 +42,7 @@ name = 'trytond_stock_quantity_early_planning' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): if not re.match(r'(ir|res)(\W|$)', dep): @@ -71,12 +54,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_production'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version) - ) setup(name=name, version=version, @@ -148,7 +125,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_quantity_early_planning/tox.ini b/modules/stock_quantity_early_planning/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_quantity_early_planning/tox.ini +++ b/modules/stock_quantity_early_planning/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_quantity_issue/.drone.yml b/modules/stock_quantity_issue/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_quantity_issue/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_quantity_issue/.flake8 b/modules/stock_quantity_issue/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_quantity_issue/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_quantity_issue/doc/conf.py b/modules/stock_quantity_issue/doc/conf.py index 8513b72dd2..4db2bff708 100644 --- a/modules/stock_quantity_issue/doc/conf.py +++ b/modules/stock_quantity_issue/doc/conf.py @@ -1,13 +1,20 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -modules_url = 'https://docs.tryton.org/projects/modules-{module}/en/{series}/' -trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' def get_info(): import configparser - import os import subprocess import sys @@ -57,5 +64,6 @@ intersphinx_mapping.update({ module=m.replace('_', '-'), series=version), None) for m in info['modules'] }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] -del get_info, info, modules_url, trytond_url +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_quantity_issue/setup.py b/modules/stock_quantity_issue/setup.py index c81d065c27..e2d4597a39 100755 --- a/modules/stock_quantity_issue/setup.py +++ b/modules/stock_quantity_issue/setup.py @@ -42,23 +42,6 @@ name = 'trytond_stock_quantity_issue' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -71,11 +54,6 @@ tests_require = [ get_require_version('proteus'), get_require_version('trytond_production'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -147,7 +125,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_quantity_issue/tox.ini b/modules/stock_quantity_issue/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_quantity_issue/tox.ini +++ b/modules/stock_quantity_issue/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_secondary_unit/.drone.yml b/modules/stock_secondary_unit/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_secondary_unit/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_secondary_unit/.flake8 b/modules/stock_secondary_unit/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_secondary_unit/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_secondary_unit/doc/conf.py b/modules/stock_secondary_unit/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_secondary_unit/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_secondary_unit/setup.py b/modules/stock_secondary_unit/setup.py index b9f732cc9e..ed871abc32 100755 --- a/modules/stock_secondary_unit/setup.py +++ b/modules/stock_secondary_unit/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_secondary_unit' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_secondary_unit/tox.ini b/modules/stock_secondary_unit/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_secondary_unit/tox.ini +++ b/modules/stock_secondary_unit/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_shipment_cost/.drone.yml b/modules/stock_shipment_cost/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_shipment_cost/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_shipment_cost/.flake8 b/modules/stock_shipment_cost/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_shipment_cost/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_shipment_cost/doc/conf.py b/modules/stock_shipment_cost/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_shipment_cost/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_shipment_cost/setup.py b/modules/stock_shipment_cost/setup.py index 3b2abba552..05eab7b3b6 100755 --- a/modules/stock_shipment_cost/setup.py +++ b/modules/stock_shipment_cost/setup.py @@ -42,23 +42,6 @@ name = 'trytond_stock_shipment_cost' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_shipment_cost/tox.ini b/modules/stock_shipment_cost/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_shipment_cost/tox.ini +++ b/modules/stock_shipment_cost/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_shipment_measurements/.drone.yml b/modules/stock_shipment_measurements/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_shipment_measurements/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_shipment_measurements/.flake8 b/modules/stock_shipment_measurements/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_shipment_measurements/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_shipment_measurements/doc/conf.py b/modules/stock_shipment_measurements/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_shipment_measurements/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_shipment_measurements/setup.py b/modules/stock_shipment_measurements/setup.py index a7e0860b4b..07a8ecd992 100755 --- a/modules/stock_shipment_measurements/setup.py +++ b/modules/stock_shipment_measurements/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_shipment_measurements' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_stock_package')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_shipment_measurements/tox.ini b/modules/stock_shipment_measurements/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_shipment_measurements/tox.ini +++ b/modules/stock_shipment_measurements/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_split/.drone.yml b/modules/stock_split/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_split/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_split/.flake8 b/modules/stock_split/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_split/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_split/doc/conf.py b/modules/stock_split/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_split/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_split/setup.py b/modules/stock_split/setup.py index 98cdb40eef..14be30f89e 100755 --- a/modules/stock_split/setup.py +++ b/modules/stock_split/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_split' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_split/tox.ini b/modules/stock_split/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_split/tox.ini +++ b/modules/stock_split/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_supply/.drone.yml b/modules/stock_supply/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_supply/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_supply/.flake8 b/modules/stock_supply/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_supply/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_supply/doc/conf.py b/modules/stock_supply/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_supply/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_supply/setup.py b/modules/stock_supply/setup.py index bc8e69143e..380bb79f7c 100755 --- a/modules/stock_supply/setup.py +++ b/modules/stock_supply/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_supply' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -136,7 +114,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_supply/tox.ini b/modules/stock_supply/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_supply/tox.ini +++ b/modules/stock_supply/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_supply_day/.drone.yml b/modules/stock_supply_day/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_supply_day/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_supply_day/.flake8 b/modules/stock_supply_day/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_supply_day/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_supply_day/doc/conf.py b/modules/stock_supply_day/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_supply_day/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_supply_day/setup.py b/modules/stock_supply_day/setup.py index 29c48be467..6b70ca653f 100755 --- a/modules/stock_supply_day/setup.py +++ b/modules/stock_supply_day/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_supply_day' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add supply weekdays', @@ -135,7 +112,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_supply_day/tox.ini b/modules/stock_supply_day/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_supply_day/tox.ini +++ b/modules/stock_supply_day/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_supply_forecast/.drone.yml b/modules/stock_supply_forecast/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_supply_forecast/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_supply_forecast/.flake8 b/modules/stock_supply_forecast/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_supply_forecast/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_supply_forecast/doc/conf.py b/modules/stock_supply_forecast/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_supply_forecast/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_supply_forecast/setup.py b/modules/stock_supply_forecast/setup.py index 4ea09195fd..11569c80ce 100755 --- a/modules/stock_supply_forecast/setup.py +++ b/modules/stock_supply_forecast/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_supply_forecast' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_supply_forecast/tox.ini b/modules/stock_supply_forecast/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_supply_forecast/tox.ini +++ b/modules/stock_supply_forecast/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/stock_supply_production/.drone.yml b/modules/stock_supply_production/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/stock_supply_production/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/stock_supply_production/.flake8 b/modules/stock_supply_production/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/stock_supply_production/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/stock_supply_production/doc/conf.py b/modules/stock_supply_production/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/stock_supply_production/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/stock_supply_production/setup.py b/modules/stock_supply_production/setup.py index c8103a7c92..a8f7258fbc 100755 --- a/modules/stock_supply_production/setup.py +++ b/modules/stock_supply_production/setup.py @@ -39,23 +39,6 @@ name = 'trytond_stock_supply_production' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -138,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/stock_supply_production/tox.ini b/modules/stock_supply_production/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/stock_supply_production/tox.ini +++ b/modules/stock_supply_production/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/timesheet/.drone.yml b/modules/timesheet/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/timesheet/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/timesheet/.flake8 b/modules/timesheet/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/timesheet/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/timesheet/doc/conf.py b/modules/timesheet/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/timesheet/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/timesheet/setup.py b/modules/timesheet/setup.py index 8916167117..0aac6d544b 100755 --- a/modules/timesheet/setup.py +++ b/modules/timesheet/setup.py @@ -42,23 +42,6 @@ name = 'trytond_timesheet' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql', 'werkzeug'] for dep in info.get('depends', []): @@ -66,12 +49,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module with timesheets', @@ -139,7 +116,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/timesheet/tox.ini b/modules/timesheet/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/timesheet/tox.ini +++ b/modules/timesheet/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/timesheet_cost/.drone.yml b/modules/timesheet_cost/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/timesheet_cost/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/timesheet_cost/.flake8 b/modules/timesheet_cost/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/timesheet_cost/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/timesheet_cost/doc/conf.py b/modules/timesheet_cost/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/timesheet_cost/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/timesheet_cost/setup.py b/modules/timesheet_cost/setup.py index 47fff9b2b4..55844178eb 100755 --- a/modules/timesheet_cost/setup.py +++ b/modules/timesheet_cost/setup.py @@ -39,23 +39,6 @@ name = 'trytond_timesheet_cost' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql >= 0.4'] for dep in info.get('depends', []): @@ -63,12 +46,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond_%s' % dep)) requires.append(get_require_version('trytond')) -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, description='Tryton module to add cost on timesheet', @@ -136,7 +113,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/timesheet_cost/tox.ini b/modules/timesheet_cost/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/timesheet_cost/tox.ini +++ b/modules/timesheet_cost/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/user_role/.drone.yml b/modules/user_role/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/user_role/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/user_role/.flake8 b/modules/user_role/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/user_role/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/user_role/doc/conf.py b/modules/user_role/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/user_role/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/user_role/setup.py b/modules/user_role/setup.py index a4f851685a..19c84381c0 100755 --- a/modules/user_role/setup.py +++ b/modules/user_role/setup.py @@ -39,23 +39,6 @@ name = 'trytond_user_role' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('proteus')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/user_role/tox.ini b/modules/user_role/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/user_role/tox.ini +++ b/modules/user_role/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/web_shop/.drone.yml b/modules/web_shop/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/web_shop/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/web_shop/.flake8 b/modules/web_shop/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/web_shop/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/web_shop/doc/conf.py b/modules/web_shop/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/web_shop/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/web_shop/setup.py b/modules/web_shop/setup.py index 85b9159f1e..d5944225a1 100755 --- a/modules/web_shop/setup.py +++ b/modules/web_shop/setup.py @@ -42,23 +42,6 @@ name = 'trytond_web_shop' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [get_require_version('trytond_product_attribute')] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/web_shop/tox.ini b/modules/web_shop/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/web_shop/tox.ini +++ b/modules/web_shop/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/web_shop_vue_storefront/.drone.yml b/modules/web_shop_vue_storefront/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/web_shop_vue_storefront/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/web_shop_vue_storefront/.flake8 b/modules/web_shop_vue_storefront/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/web_shop_vue_storefront/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/web_shop_vue_storefront/doc/conf.py b/modules/web_shop_vue_storefront/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/web_shop_vue_storefront/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/web_shop_vue_storefront/setup.py b/modules/web_shop_vue_storefront/setup.py index 615d642665..952ea8af78 100755 --- a/modules/web_shop_vue_storefront/setup.py +++ b/modules/web_shop_vue_storefront/setup.py @@ -42,23 +42,6 @@ name = 'trytond_web_shop_vue_storefront' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['elasticsearch', 'python-stdnum >= 1.1.0', 'werkzeug'] for dep in info.get('depends', []): @@ -73,11 +56,6 @@ tests_require = [ get_require_version('trytond_sale_shipment_cost'), get_require_version('trytond_carrier'), ] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -147,7 +125,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/web_shop_vue_storefront/tox.ini b/modules/web_shop_vue_storefront/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/web_shop_vue_storefront/tox.ini +++ b/modules/web_shop_vue_storefront/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/web_shop_vue_storefront_stripe/.drone.yml b/modules/web_shop_vue_storefront_stripe/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/web_shop_vue_storefront_stripe/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/web_shop_vue_storefront_stripe/.flake8 b/modules/web_shop_vue_storefront_stripe/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/web_shop_vue_storefront_stripe/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/web_shop_vue_storefront_stripe/doc/conf.py b/modules/web_shop_vue_storefront_stripe/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/web_shop_vue_storefront_stripe/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/web_shop_vue_storefront_stripe/setup.py b/modules/web_shop_vue_storefront_stripe/setup.py index 1d5c89539f..f3a44ffff7 100755 --- a/modules/web_shop_vue_storefront_stripe/setup.py +++ b/modules/web_shop_vue_storefront_stripe/setup.py @@ -42,23 +42,6 @@ name = 'trytond_web_shop_vue_storefront_stripe' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -67,11 +50,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -142,7 +120,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/web_shop_vue_storefront_stripe/tox.ini b/modules/web_shop_vue_storefront_stripe/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/web_shop_vue_storefront_stripe/tox.ini +++ b/modules/web_shop_vue_storefront_stripe/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/web_shortener/.drone.yml b/modules/web_shortener/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/web_shortener/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/web_shortener/.flake8 b/modules/web_shortener/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/web_shortener/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/web_shortener/doc/conf.py b/modules/web_shortener/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/web_shortener/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/web_shortener/setup.py b/modules/web_shortener/setup.py index 609534f6e2..add29a2aa8 100755 --- a/modules/web_shortener/setup.py +++ b/modules/web_shortener/setup.py @@ -39,23 +39,6 @@ name = 'trytond_web_shortener' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['python-sql', 'werkzeug'] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -137,7 +115,6 @@ setup(name=name, license='GPL-3', python_requires='>=3.6', install_requires=requires, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/web_shortener/tox.ini b/modules/web_shortener/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/web_shortener/tox.ini +++ b/modules/web_shortener/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/modules/web_user/.drone.yml b/modules/web_user/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/modules/web_user/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/modules/web_user/.flake8 b/modules/web_user/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/modules/web_user/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/modules/web_user/doc/conf.py b/modules/web_user/doc/conf.py new file mode 100644 index 0000000000..4db2bff708 --- /dev/null +++ b/modules/web_user/doc/conf.py @@ -0,0 +1,69 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +import os + +base_url = os.environ.get('DOC_BASE_URL') +if base_url: + modules_url = base_url + '/modules-{module}/' + trytond_url = base_url + '/server/' +else: + modules_url = ( + 'https://docs.tryton.org/projects/modules-{module}/en/{series}/') + trytond_url = 'https://docs.tryton.org/projects/server/en/{series}/' + + +def get_info(): + import configparser + import subprocess + import sys + + module_dir = os.path.dirname(os.path.dirname(__file__)) + + config = configparser.ConfigParser() + config.read_file(open(os.path.join(module_dir, 'tryton.cfg'))) + info = dict(config.items('tryton')) + + result = subprocess.run( + [sys.executable, 'setup.py', '--name'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + info['name'] = result.stdout.decode('utf-8').strip() + + result = subprocess.run( + [sys.executable, 'setup.py', '--version'], + stdout=subprocess.PIPE, check=True, cwd=module_dir) + version = result.stdout.decode('utf-8').strip() + if 'dev' in version: + info['series'] = 'latest' + else: + info['series'] = '.'.join(version.split('.', 2)[:2]) + + for key in {'depends', 'extras_depend'}: + info[key] = info.get(key, '').strip().splitlines() + info['modules'] = set(info['depends'] + info['extras_depend']) + info['modules'] -= {'ir', 'res'} + + return info + + +info = get_info() + +master_doc = 'index' +project = info['name'] +release = version = info['series'] +default_role = 'ref' +highlight_language = 'none' +extensions = [ + 'sphinx.ext.intersphinx', + ] +intersphinx_mapping = { + 'trytond': (trytond_url.format(series=version), None), + } +intersphinx_mapping.update({ + m: (modules_url.format( + module=m.replace('_', '-'), series=version), None) + for m in info['modules'] + }) +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] + +del get_info, info, base_url, modules_url, trytond_url diff --git a/modules/web_user/setup.py b/modules/web_user/setup.py index 7f3bd44922..3a71bd727c 100755 --- a/modules/web_user/setup.py +++ b/modules/web_user/setup.py @@ -39,23 +39,6 @@ name = 'trytond_web_user' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = ( - 'hg+http://hg.tryton.org/modules/%s#egg=%s-%s' % ( - name[8:], name, version)) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = [] for dep in info.get('depends', []): @@ -64,11 +47,6 @@ for dep in info.get('depends', []): requires.append(get_require_version('trytond')) tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -140,7 +118,6 @@ setup(name=name, 'BCrypt': ['bcrypt'], 'html2text': ['html2text'], }, - dependency_links=dependency_links, zip_safe=False, entry_points=""" [trytond.modules] diff --git a/modules/web_user/tox.ini b/modules/web_user/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/modules/web_user/tox.ini +++ b/modules/web_user/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test} diff --git a/proteus/.drone.yml b/proteus/.drone.yml deleted file mode 100644 index d8e4ca7b1d..0000000000 --- a/proteus/.drone.yml +++ /dev/null @@ -1,40 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - TOX_TESTENV_PASSENV=CFLAGS CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox pydot - - tox -e "${TOXENV}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - - IMAGE: python:3.7 - TOXENV: py37 - - IMAGE: python:3.8 - TOXENV: py38 - - IMAGE: python:3.9 - TOXENV: py39 diff --git a/proteus/.flake8 b/proteus/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/proteus/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/proteus/setup.py b/proteus/setup.py index 25f0c40fe2..861fb4bbb7 100755 --- a/proteus/setup.py +++ b/proteus/setup.py @@ -36,28 +36,6 @@ minor_version = int(minor_version) download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % ( - name, name, version) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) - -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) setup(name=name, version=version, @@ -104,7 +82,6 @@ setup(name=name, extras_require={ 'trytond': [get_require_version('trytond')], }, - dependency_links=dependency_links, zip_safe=True, test_suite='proteus.tests', tests_require=[get_require_version('trytond'), diff --git a/proteus/tox.ini b/proteus/tox.ini index 21a156aa54..8d8507b428 100644 --- a/proteus/tox.ini +++ b/proteus/tox.ini @@ -4,7 +4,7 @@ envlist = py36,py37,py38,py39,pypy3 [testenv] commands = {envpython} setup.py test deps = +passenv = * setenv = TRYTOND_DATABASE_URI={env:TRYTOND_DATBASE_URI:sqlite://} DB_NAME={env:DB_NAME::memory:} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} diff --git a/readthedocs/conf.py b/readthedocs/conf.py new file mode 100644 index 0000000000..9d44983dd4 --- /dev/null +++ b/readthedocs/conf.py @@ -0,0 +1,8 @@ +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. + +master_doc = 'index' +project = "Tryton Documentation" +default_role = 'ref' +highlight_language = 'none' +linkcheck_ignore = [r'/.*', r'https://demo.tryton.org/*'] diff --git a/sao/.drone.yml b/sao/.drone.yml deleted file mode 100644 index e2a994d6b3..0000000000 --- a/sao/.drone.yml +++ /dev/null @@ -1,17 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - npm: - image: tryton/sao-test - commands: - - sh .bower_allow_root.sh - - npm -s install --unsafe-perm --legacy-peer-deps - - npm test - volumes: - - cache-npm:/root/.npm diff --git a/tryton/.drone.yml b/tryton/.drone.yml deleted file mode 100644 index 1e33a514f1..0000000000 --- a/tryton/.drone.yml +++ /dev/null @@ -1,36 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - TOX_TESTENV_PASSENV=CFLAGS CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - commands: - - pip install tox - - tox -e "${TOXENV}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -matrix: - include: - - IMAGE: tryton/tryton-test:3.6 - TOXENV: py36 - - IMAGE: tryton/tryton-test:3.7 - TOXENV: py37 - - IMAGE: tryton/tryton-test:3.8 - TOXENV: py38 - - IMAGE: tryton/tryton-test:3.9 - TOXENV: py39 diff --git a/tryton/.flake8 b/tryton/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/tryton/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/tryton/setup.py b/tryton/setup.py index 54f8a4970d..20b6e56466 100755 --- a/tryton/setup.py +++ b/tryton/setup.py @@ -69,28 +69,6 @@ name = 'tryton' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % ( - name, name, version) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) - -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) dist = setup(name=name, version=version, @@ -157,7 +135,6 @@ dist = setup(name=name, extras_require={ 'calendar': ['GooCalendar>=0.7'], }, - dependency_links=dependency_links, zip_safe=False, test_suite='tryton.tests', **args diff --git a/tryton/tox.ini b/tryton/tox.ini index 08a6566d3a..228a48884c 100644 --- a/tryton/tox.ini +++ b/tryton/tox.ini @@ -3,4 +3,4 @@ envlist = py36,py37,py38,py39 [testenv] commands = {envpython} setup.py test -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} +passenv = * diff --git a/trytond-gis/.drone.yml b/trytond-gis/.drone.yml deleted file mode 100644 index b3ce02e151..0000000000 --- a/trytond-gis/.drone.yml +++ /dev/null @@ -1,49 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGIS_URI=postgis://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgis/postgis - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - - IMAGE: python:3.7 - TOXENV: py37 - - IMAGE: python:3.8 - TOXENV: py38 - - IMAGE: python:3.9 - TOXENV: py39 diff --git a/trytond-gis/.flake8 b/trytond-gis/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/trytond-gis/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/trytond-gis/setup.py b/trytond-gis/setup.py index 06f2a56ff2..97c57e068a 100755 --- a/trytond-gis/setup.py +++ b/trytond-gis/setup.py @@ -36,32 +36,10 @@ name = 'trytond_gis' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % ( - name, name, version) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) requires = ['geomet', get_require_version('trytond'), 'psycopg2 >= 2.0.14'] tests_require = [] -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) - setup(name=name, version=version, @@ -103,7 +81,6 @@ setup(name=name, 'test_geographic_fields = trytond_gis.tests', ], }, - dependency_links=dependency_links, zip_safe=False, test_suite='trytond.tests', test_loader='trytond.test_loader:Loader', diff --git a/trytond-gis/tox.ini b/trytond-gis/tox.ini index d765893484..36b10547fc 100644 --- a/trytond-gis/tox.ini +++ b/trytond-gis/tox.ini @@ -3,7 +3,7 @@ envlist = py36,py37,py38,py39 [testenv] commands = {envpython} setup.py test +passenv = * setenv = TRYTOND_DATABASE_URI={env:POSTGIS_URI:postgis://} - DB_NAME={env:POSTGIS_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + DB_NAME={env:DB_NAME:test} diff --git a/trytond/.drone.yml b/trytond/.drone.yml deleted file mode 100644 index 2049d30a49..0000000000 --- a/trytond/.drone.yml +++ /dev/null @@ -1,68 +0,0 @@ -clone: - hg: - image: plugins/hg - environment: - - HG_SHARE_POOL=/root/.cache/hg - volumes: - - cache:/root/.cache - -pipeline: - tox: - image: ${IMAGE} - environment: - - CFLAGS=-O0 - - DB_CACHE=/cache - - TOX_TESTENV_PASSENV=CFLAGS DB_CACHE CI_BUILD_NUMBER CI_JOB_NUMBER CI_JOB_ID - - POSTGRESQL_URI=postgresql://postgres@postgresql:5432/ - commands: - - echo "[extensions]" >> /root/.hgrc - - echo "hgext.share =" >> /root/.hgrc - - echo "[share]" >> /root/.hgrc - - echo "pool = /root/.cache/hg" >> /root/.hgrc - - pip install tox - - tox -e "${TOXENV}-${DATABASE}" - volumes: - - cache:/root/.cache - check_dist: - image: ${IMAGE} - commands: - - pip install twine - - python setup.py sdist - - twine check dist/* - -services: - postgresql: - image: postgres - environment: - - POSTGRES_HOST_AUTH_METHOD=trust - command: "-c fsync=off -c synchronous_commit=off -c full_page_writes=off" - when: - matrix: - DATABASE: postgresql - -matrix: - include: - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: sqlite - - IMAGE: python:3.6 - TOXENV: py36 - DATABASE: postgresql - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: sqlite - - IMAGE: python:3.7 - TOXENV: py37 - DATABASE: postgresql - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: sqlite - - IMAGE: python:3.8 - TOXENV: py38 - DATABASE: postgresql - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: sqlite - - IMAGE: python:3.9 - TOXENV: py39 - DATABASE: postgresql diff --git a/trytond/.flake8 b/trytond/.flake8 deleted file mode 100644 index fa6b4f66d1..0000000000 --- a/trytond/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -ignore=E123,E124,E126,E128,E741,W503 diff --git a/trytond/setup.py b/trytond/setup.py index 7f808b5d60..637f6e041b 100755 --- a/trytond/setup.py +++ b/trytond/setup.py @@ -49,28 +49,6 @@ name = 'trytond' download_url = 'http://downloads.tryton.org/%s.%s/' % ( major_version, minor_version) -if minor_version % 2: - version = '%s.%s.dev0' % (major_version, minor_version) - download_url = 'hg+http://hg.tryton.org/%s#egg=%s-%s' % ( - name, name, version) -local_version = [] -if os.environ.get('CI_JOB_ID'): - local_version.append(os.environ['CI_JOB_ID']) -else: - for build in ['CI_BUILD_NUMBER', 'CI_JOB_NUMBER']: - if os.environ.get(build): - local_version.append(os.environ[build]) - else: - local_version = [] - break -if local_version: - version += '+' + '.'.join(local_version) - -dependency_links = [] -if minor_version % 2: - dependency_links.append( - 'https://trydevpi.tryton.org/?local_version=' - + '.'.join(local_version)) if platform.python_implementation() == 'PyPy': pg_require = ['psycopg2cffi > 2.9.0'] @@ -177,7 +155,6 @@ setup(name=name, 'coroutine': ['gevent>=1.1'], 'image': ['pillow'], }, - dependency_links=dependency_links, zip_safe=False, test_suite='trytond.tests', test_loader='trytond.test_loader:Loader', diff --git a/trytond/tox.ini b/trytond/tox.ini index 197496c0cb..38c7d407f5 100644 --- a/trytond/tox.ini +++ b/trytond/tox.ini @@ -7,9 +7,9 @@ deps = {py36,py37,py38,py39}-postgresql: psycopg2 >= 2.5 pypy3-postgresql: psycopg2cffi >= 2.5 py36-sqlite: sqlitebck +passenv = * setenv = sqlite: TRYTOND_DATABASE_URI={env:SQLITE_URI:sqlite://} postgresql: TRYTOND_DATABASE_URI={env:POSTGRESQL_URI:postgresql://} - sqlite: DB_NAME={env:SQLITE_NAME::memory:} - postgresql: DB_NAME={env:POSTGRESQL_NAME:test} -install_command = pip install --pre --find-links https://trydevpi.tryton.org/?local_version={env:CI_JOB_ID:{env:CI_BUILD_NUMBER}.{env:CI_JOB_NUMBER}} {opts} {packages} + sqlite: DB_NAME={env:DB_NAME::memory:} + postgresql: DB_NAME={env:DB_NAME:test}