Commit 617242c1 authored by Noé Gaumont's avatar Noé Gaumont 🐙
Browse files

fix: remove add-deb-publish

parent 9cf0c8d5f03a
Pipeline #74001 passed with stage
in 1 minute and 5 seconds
......@@ -6,7 +6,6 @@ from cube_doctor import EmptyCubeQueryResult
from cube_doctor.transforms.add_tox import AddTox # noqa
from cube_doctor.transforms.add_pypi_publish import AddPypiPublish
from cube_doctor.transforms.add_deb_publish import AddDebPublish
from cube_doctor.transforms.automatic_upgrade_of_dependencies import (
AutoUpgradeDependencies,
)
......@@ -90,7 +89,6 @@ commands = {
# "add-tox": AddTox().workflow,
"add-pytest-deprecated-warnings-cmd": CaptureDeprecatedWarnings().workflow,
"add-pypi-publish": AddPypiPublish().workflow,
"add-deb-publish": AddDebPublish().workflow,
"add-yamllint": AddYamlLint().workflow,
"add-release-new": AddReleaseNew().workflow,
"replace-set-attributes": ReplaceSetAttributesWithSetCW().workflow,
......
from tox.config import parseconfig
from cube_doctor import Command
DEB_PUBLISHED = """
[testenv:deb-publish]
passenv = JENKINS_USER JENKINS_TOKEN
basepython = python3
skip_install = true
whitelist_externals =
rm
sh
hg
python3
deps =
httpie
commands =
hg clean --all --dirs --files
rm -rf build dist .egg .egg-info
python3 setup.py sdist
sh -c "PACKAGE_NAME=$(python3 setup.py --name) && VERSION=$(python3 setup.py --version) && \\
cd dist && \\
tar xf $PACKAGE_NAME-$VERSION.tar.gz && \\
cd $PACKAGE_NAME-$VERSION && \\
cp -a {toxinidir}/debian . && \\
mk-origtargz --rename ../$PACKAGE_NAME-$VERSION.tar.gz && \\
dpkg-buildpackage -us -uc --no-check-builddeps --build=source "
sh -c "cd dist && dcmd zip latest.zip *.changes"
http -f POST https://{env:JENKINS_USER}:{env:JENKINS_TOKEN}@jenkins.intra.logilab.fr/job/pkg-from-dsc/buildWithParameters DIST=buster source.zip@dist/latest.zip REPO=buster PUBLISH=true
""" # noqa
class AddDebPublish(Command):
BRANCH_NAME = "topic/default/deb-publish"
commit_message = "chore(tox): add deb-publish"
TARGETS = ("cubes",)
base_query = "?project lgg:has_deb_publish false . " "?project lgg:has_tox true ."
NO_AUTO_MR = False
def pre_check(self, root_files):
if "tox.ini" not in root_files:
return "continue"
if "setup.py" not in root_files:
return "continue"
def modify_code(self, cube, repo, root_files, branches, other_args):
tox_ini_path = repo.path / "tox.ini"
tox = parseconfig(["-c", str(tox_ini_path)])
if "deb-publish" in tox.envconfigs:
return
tox_content = repo.read_file("tox.ini")
tox_content = tox_content.rstrip() + DEB_PUBLISHED
repo.write_file("tox.ini", tox_content)
yield {"branch_name": self.BRANCH_NAME, "commit_message": self.commit_message}
[tox]
envlist = py3
[testenv]
deps =
pytest
commands =
{envpython} -m pytest {posargs:test}
[tox]
envlist = py3
[testenv]
deps =
pytest
commands =
{envpython} -m pytest {posargs:test}
[testenv:deb-publish]
passenv = JENKINS_USER JENKINS_TOKEN
basepython = python3
skip_install = true
whitelist_externals =
rm
sh
hg
python3
deps =
httpie
commands =
hg clean --all --dirs --files
rm -rf build dist .egg .egg-info
python3 setup.py sdist
sh -c "PACKAGE_NAME=$(python3 setup.py --name) && VERSION=$(python3 setup.py --version) && \
cd dist && \
tar xf $PACKAGE_NAME-$VERSION.tar.gz && \
cd $PACKAGE_NAME-$VERSION && \
cp -a {toxinidir}/debian . && \
mk-origtargz --rename ../$PACKAGE_NAME-$VERSION.tar.gz && \
dpkg-buildpackage -us -uc --no-check-builddeps --build=source "
sh -c "cd dist && dcmd zip latest.zip *.changes"
http -f POST https://{env:JENKINS_USER}:{env:JENKINS_TOKEN}@jenkins.intra.logilab.fr/job/pkg-from-dsc/buildWithParameters DIST=buster source.zip@dist/latest.zip REPO=buster PUBLISH=true
import unittest
from cube_doctor.transforms.add_deb_publish import AddDebPublish
from . import BaseCommandTC, TEST_DATA
class AddDebPublishTC(BaseCommandTC):
def test_adddebpublish(self):
data_input = TEST_DATA / "add_deb_publish" / "in"
data_output = TEST_DATA / "add_deb_publish" / "out"
self.base_execution(AddDebPublish(), data_input, data_output)
def test_adddebpublish_indempotent(self):
data_output = TEST_DATA / "add_deb_publish" / "out"
self.base_execution(AddDebPublish(), data_output, data_output)
if __name__ == "__main__":
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment