Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for Python 3.6 and lower #223

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
3c7d252
Updated to support Python3 using 2to3
jpwhite3 Feb 17, 2021
61173c4
Use subprocess.Popen default buffer size
jpwhite3 Feb 23, 2021
c67963f
Adding makefile
jpwhite3 Feb 27, 2021
bb291b3
Fixed tests
jpwhite3 Feb 27, 2021
88a25f9
Added requirements building
jpwhite3 Feb 28, 2021
6f6e9cf
Added requirements.txt
jpwhite3 Feb 28, 2021
2dd72c1
Create python-package.yml
jpwhite3 Feb 28, 2021
c17c579
Massive Linting and clean up
jpwhite3 Feb 28, 2021
306f52e
Removing requirements.txt generation
jpwhite3 Feb 28, 2021
e725912
Ci Setup
jpwhite3 Feb 28, 2021
903a5f5
CI
jpwhite3 Feb 28, 2021
7a5bb05
Fixing pyproject.toml
jpwhite3 Feb 28, 2021
d35acca
Testing
jpwhite3 Feb 28, 2021
83a9217
CI
jpwhite3 Feb 28, 2021
636fd09
Coveralls
jpwhite3 Feb 28, 2021
0529328
Coveralls
jpwhite3 Feb 28, 2021
20e7319
Coveralls
jpwhite3 Feb 28, 2021
5127a27
Coveralls
jpwhite3 Feb 28, 2021
e936701
Coveralls
jpwhite3 Feb 28, 2021
784f0b1
Build Badge
jpwhite3 Feb 28, 2021
6843dee
Build Badge
jpwhite3 Feb 28, 2021
0bfacc1
gitignore
jpwhite3 Feb 28, 2021
4dfb314
Save
jpwhite3 Mar 1, 2021
6ef6397
Badge
jpwhite3 Mar 1, 2021
799c153
Badge
jpwhite3 Mar 1, 2021
53d81bc
tests
jpwhite3 Mar 1, 2021
23cbb29
More tests
jpwhite3 Mar 3, 2021
6bf75a4
More tests
jpwhite3 Mar 4, 2021
8bbac57
More tests
jpwhite3 Mar 4, 2021
c52bd20
More tests
jpwhite3 Mar 14, 2021
9956e76
More tests
jpwhite3 Mar 18, 2021
ec67def
Automating release
jpwhite3 Apr 5, 2021
caf5e88
Adding pipfile.lock to automate requirements
jpwhite3 Apr 5, 2021
da74b94
Create codeql-analysis.yml
jpwhite3 Apr 5, 2021
32fc7ba
Removing CodeQL scanning for .cpp files
jpwhite3 Apr 5, 2021
488ec31
Bump urllib3 from 1.26.3 to 1.26.4
dependabot[bot] Apr 6, 2021
5208d91
Update auto-merge.yml
jpwhite3 Apr 7, 2021
694fc2a
Merge pull request #2 from jpwhite3/dependabot/pip/urllib3-1.26.4
jpwhite3 Apr 7, 2021
7d46430
More tests
jpwhite3 May 13, 2021
54960ee
Bump urllib3 from 1.26.4 to 1.26.5
dependabot[bot] Jun 2, 2021
7b74648
Merge pull request #3 from jpwhite3/dependabot/pip/urllib3-1.26.5
jpwhite3 Jun 4, 2021
7911fcf
This change-set drops support for Python 2.7 and lower. It also adds …
jpwhite3 Jun 20, 2021
7b9d394
Converting space indentation back to tabs
jpwhite3 Jun 23, 2021
e896310
Resolving pylint R0205 warnings
jpwhite3 Jun 23, 2021
271fc04
Removing support for Python 3.6 as it is end of life
jpwhite3 Mar 1, 2022
28e155b
Removing linting and coverage from default CI action
jpwhite3 Mar 1, 2022
f446030
Fixing Python 3.10 version to 3.10.2
jpwhite3 Mar 1, 2022
639fdea
Upgrading pytest to 7.0.1 for compatability with Python 3.10
jpwhite3 Mar 1, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[run]
relative_files = True
67 changes: 67 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '27 19 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: [ 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
37 changes: 37 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
branches: [ master, develop, feature/** ]
pull_request:
branches: [ master ]

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, 3.10.2]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Test with pytest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make test
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Test
run: make dist

- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
files: dist/*
fail_on_unmatched_files: true
prerelease: ${{ endsWith(github.ref, 'dev') || endsWith(github.ref, 'pre') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ node_modules
*.egg-info
*.pyc
*.tgz
.DS_Store
.coverage
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.PHONY: clean clean-test clean-pyc clean-build docs help
.DEFAULT_GOAL := help

define PRINT_HELP_PYSCRIPT
import re, sys

for line in sys.stdin:
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)
if match:
target, help = match.groups()
print("%-20s %s" % (target, help))
endef
export PRINT_HELP_PYSCRIPT

help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +

clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +

clean-test: ## remove test and coverage artifacts
rm -f .coverage
rm -fr .pytest_cache

lint: ## check style with flake8 and pylint
pylint --rcfile=.pylintrc gitinspector
# stop the build if there are Python syntax errors or undefined names
flake8 gitinspector tests --count --select=E9,F63,F7,F82 --show-source --statistics --builtins="_"
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 gitinspector tests --count --ignore=E203,E722,W503,E401,C901 --exit-zero --max-complexity=10 --max-line-length=127 --statistics --builtins="_"

format: ## auto format all the code with black
black ./gitinspector --line-length 127

test: ## run tests quickly with the default Python
pytest

test-debug: ## run tests with debugging enabled
LOGLEVEL=debug; py.test -s --pdb

test-coverage: ## check code coverage quickly with the default Python
coverage run --source gitinspector -m pytest
coverage report -m

test-coverage-report: test-coverage ## Report coverage to Coveralls
coveralls

release: dist ## package and upload a release
twine upload dist/*

tag-version:
@export VERSION_TAG=`python3 -c "from gitinspector.version import __version__; print(__version__)"` \
&& git tag v$$VERSION_TAG

untag-version:
@export VERSION_TAG=`python3 -c "from gitinspector.version import __version__; print(__version__)"` \
&& git tag -d v$$VERSION_TAG

push-tagged-version: tag-version
@export VERSION_TAG=`python3 -c "from gitinspector.version import __version__; print(__version__)"` \
&& git push origin v$$VERSION_TAG

dist: clean ## builds source and wheel package
python3 setup.py sdist
python3 setup.py bdist_wheel
ls -l dist

install: clean ## install the package to the active Python's site-packages
python3 setup.py install

requirements:
pipenv lock -r --dev > requirements.txt
18 changes: 18 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
black-but-with-tabs-instead-of-spaces = "*"
pytest = "*"

[dev-packages]
pytest = "*"
flake8 = "*"
twine = "*"
coverage = "*"
coveralls = "*"

[pipenv]
allow_prereleases = true
Loading