From 66c97e91e1b80300c6ed4ae4f5570f8899790de5 Mon Sep 17 00:00:00 2001 From: Guilherme Carraro Martins Date: Mon, 21 Oct 2019 11:17:42 +0200 Subject: [PATCH 01/10] Changed to Python3 instead of regular Pythong --- kcleaner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kcleaner.py b/kcleaner.py index b7d821b..7b6e4cd 100755 --- a/kcleaner.py +++ b/kcleaner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import os import logging import click @@ -6,6 +6,7 @@ from pathlib import Path from iterfzf import iterfzf import datetime +from __future__ import print_function backup_limit = 10 backup_date_format = '%Y-%m-%d_%H-%M-%S' @@ -13,7 +14,7 @@ def ask_yn(yn_question, default='n'): tries = 0 while True: - response = input(f"{yn_question}(y/n)") + response = input("%s (y/n)" % (yn_question)) tries = tries + 1 if response in ['y', 'n']: break From 9092810269cc239848968850fde2d8a0fd2c3159 Mon Sep 17 00:00:00 2001 From: Guilherme Carraro Martins Date: Tue, 22 Oct 2019 17:00:42 +0200 Subject: [PATCH 02/10] Bumped up the version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 885250f..cbd1ddf 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='kcleaner', - version='0.3.0', + version='0.3.1', author='Gui Martins', url='https://fancywhale.ca/', author_email='gui.martins.94@outlook.com', From 019feb0cb9c57559aee06ee05540fa47585bf097 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 11:46:47 -0400 Subject: [PATCH 03/10] Delete azure-pipelines.yml --- azure-pipelines.yml | 114 -------------------------------------------- 1 file changed, 114 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ff1a45e..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,114 +0,0 @@ -# Python package - -# Create and test a Python package on multiple Python versions. -# Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/python - -trigger: - branches: - include: - - master - -pool: - vmImage: 'ubuntu-latest' -strategy: - matrix: - Python36: - python.version: '3.6' - Python37: - python.version: '3.7' - -steps: -- task: UsePythonVersion@0 - inputs: - versionSpec: '$(python.version)' - displayName: 'Use Python $(python.version)' - -- script: | - echo "Getting version from the setup.py file..." - ApplicationVersion=$(cat setup.py | grep version | cut -d '=' -f 2 | cut -d "'" -f 2) - echo "setup.py file version: $ApplicationVersion" - echo "Testing if this version already exists in GitHub..." - echo "Get the tags first..." - tags=$(curl https://api.github.com/repos/gcarrarom/kubeconfig-cleaner-cli/tags) - - echo "check if there's a match on the version.." - Match=$(echo $tags | jq -r ".[] | select(.name == \"v$ApplicationVersion\")") - - if [[ -z "$Match" ]]; then - echo "All good, this doesn't match any old versions" - else - echo "Nope, we have this already... try choosing another one ;)" - exit 100 - fi - - echo "Version to be used: $ApplicationVersion" - echo "##vso[task.setvariable variable=ApplicationVersion]$ApplicationVersion" - displayName: 'Get application Version' - -- script: | - python -m pip install --upgrade pip - pip install pytest-cov - pip install . - pip install testfixtures - pip install mock - displayName: 'Install dependencies' - -- script: | - pip install pytest pytest-azurepipelines - pytest --junitxml=$(System.DefaultWorkingDirectory)/testResults.xml --cov=kcleaner --cov-report=html --cov-report=xml - displayName: 'pytest' - -- task: PublishTestResults@2 - displayName: 'Publish test results' - inputs: - testResultsFiles: '$(System.DefaultWorkingDirectory)/testResults.xml' - testRunTitle: Tests - -- task: PublishCodeCoverageResults@1 - displayName: "publishing code coverage" - inputs: - codeCoverageTool: 'Cobertura' - summaryFileLocation: '$(System.DefaultWorkingDirectory)/test-cov.xml' - reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov' - additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/htmlcov/**' - failIfCoverageEmpty: true - -- task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)' - Contents: '*.py' - TargetFolder: '$(Build.ArtifactStagingDirectory)/code' - CleanTargetFolder: true - displayName: 'Copying Python files to the Staging directory' - -- task: CopyFiles@2 - inputs: - SourceFolder: '$(Build.SourcesDirectory)' - Contents: 'README.MD' - TargetFolder: '$(Build.ArtifactStagingDirectory)/code' - CleanTargetFolder: true - displayName: 'Copying ReadMe.md file to the Staging directory' - -- task: ArchiveFiles@2 - inputs: - rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/code' - includeRootFolder: true - archiveType: 'tar' - archiveFile: '$(Build.ArtifactStagingDirectory)/drop/kcleaner-v$(ApplicationVersion)-$(Build.BuildNumber).tar.gz' - replaceExistingArchive: true - displayName: 'Archiving release files to tar.gz file' - -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)/drop' - ArtifactName: 'drop' - publishLocation: 'Container' - displayName: 'Publishing Drop Artifacts' - -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)/code' - ArtifactName: 'code' - publishLocation: 'Container' - displayName: 'Publishing Code Artifacts' From ed0f4b5d501aee2e57d64f978c22d637b7e67a2f Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 11:50:03 -0400 Subject: [PATCH 04/10] Python Version matrix --- .github/workflows/pythonapp.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 5faa7d9..e5851bf 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -8,19 +8,24 @@ on: branches: [ master ] pull_request: branches: [ master ] +strategy: jobs: build: if: "!contains(github.event.head_commit.message, 'skip ci')" - + strategy: + matrix: + python_version: [3.7,3.8] + + fail-fast: true runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Set up Python 3.7 + - name: Set up Python ${{ matrix.python_version }} uses: actions/setup-python@v1 with: - python-version: 3.7 + python-version: ${{ matrix.python_version }} - name: Install dependencies run: | python -m pip install --upgrade pip From 0785860bbcb8e1bd0b64221e7d5cc2460f8f9ff5 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 11:51:12 -0400 Subject: [PATCH 05/10] I'm dummy --- .github/workflows/pythonapp.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index e5851bf..068cd10 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -8,7 +8,6 @@ on: branches: [ master ] pull_request: branches: [ master ] -strategy: jobs: build: From 73037600717132bdc7b50901cb9f5ea42a4dafe3 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 12:24:13 -0400 Subject: [PATCH 06/10] Different way of testing --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 068cd10..597cab9 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -39,7 +39,7 @@ jobs: - name: Test with pytest run: | pip install pytest - python -m pytest + pytest release: if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'" From 7ca83894bf1bdab26bd4a3fb18d3b37084258396 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 12:27:36 -0400 Subject: [PATCH 07/10] Once again... --- kcleaner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcleaner.py b/kcleaner.py index ade661e..10d8d71 100755 --- a/kcleaner.py +++ b/kcleaner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python from __future__ import print_function import os import logging From 29241f33df806b8fda1ac39a7a11548eba18da90 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 12:28:17 -0400 Subject: [PATCH 08/10] back again --- .github/workflows/pythonapp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 597cab9..068cd10 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -39,7 +39,7 @@ jobs: - name: Test with pytest run: | pip install pytest - pytest + python -m pytest release: if: "!contains(github.event.head_commit.message, 'skip ci') && github.event_name == 'push' && github.ref == 'refs/heads/master'" From d98dfa03187945fe47e25ac3304363f3771db9f0 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 12:29:38 -0400 Subject: [PATCH 09/10] Moved to the top --- kcleaner.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kcleaner.py b/kcleaner.py index 10d8d71..63612d6 100755 --- a/kcleaner.py +++ b/kcleaner.py @@ -7,7 +7,6 @@ from pathlib import Path from iterfzf import iterfzf import datetime -from __future__ import print_function backup_limit = 10 backup_date_format = '%Y-%m-%d_%H-%M-%S' From 97d3fdc42476d7d4663c5310e34e945092cf0719 Mon Sep 17 00:00:00 2001 From: Gui Martins Date: Mon, 20 Apr 2020 12:49:35 -0400 Subject: [PATCH 10/10] Bumped up the Version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cbd1ddf..f61c1b3 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='kcleaner', - version='0.3.1', + version='0.3.2', author='Gui Martins', url='https://fancywhale.ca/', author_email='gui.martins.94@outlook.com',