Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #13 from ESKYoung/drop-python-3.6-3.7-support
Browse files Browse the repository at this point in the history
refactor: drop Python 3.6-3.7 support
  • Loading branch information
ESKYoung committed Jun 21, 2022
2 parents aef0c20 + bb81050 commit 44ad351
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 62 deletions.
26 changes: 18 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://gitlab.com/pycqa/flake8
rev: master
- repo: local
hooks:
- id: flake8
- repo: https://github.com/Yelp/detect-secrets
rev: v0.13.1
hooks:
name: flake8
entry: flake8
language: system
types: [python]
require_serial: true
- id: detect-secrets
name: Detect secrets
entry: detect-secrets-hook
language: system
args: ['--baseline', '.secrets.baseline']
exclude: .*/tests/.*
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
language: system
args: ['--maxkb=5120']
- id: end-of-file-fixer
name: Fix End of Files
entry: end-of-file-fixer
language: system
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
language: system
74 changes: 53 additions & 21 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"exclude": {
"files": null,
"lines": null
},
"generated_at": "2020-10-18T09:20:33Z",
"plugins_used": [
{
Expand All @@ -12,8 +8,8 @@
"name": "ArtifactoryDetector"
},
{
"base64_limit": 4.5,
"name": "Base64HighEntropyString"
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
Expand All @@ -22,8 +18,8 @@
"name": "CloudantDetector"
},
{
"hex_limit": 3,
"name": "HexHighEntropyString"
"name": "HexHighEntropyString",
"limit": 3
},
{
"name": "IbmCloudIamDetector"
Expand Down Expand Up @@ -60,38 +56,74 @@
"results": {
"tests/test_main.py": [
{
"type": "Hex High Entropy String",
"filename": "tests/test_main.py",
"hashed_secret": "65b5658c038dcc7b3f9ee80669c0f26ac1441d05",
"is_secret": true,
"is_verified": false,
"line_number": 58,
"type": "Hex High Entropy String"
"is_secret": true
},
{
"type": "Hex High Entropy String",
"filename": "tests/test_main.py",
"hashed_secret": "5e18621e95bc4b9b75d7d5b097929ecfc9494078",
"is_secret": true,
"is_verified": false,
"line_number": 59,
"type": "Hex High Entropy String"
"is_secret": true
},
{
"type": "Hex High Entropy String",
"filename": "tests/test_main.py",
"hashed_secret": "2b2718d1211a6b3c6ae4ef13c63469cb1eafa6c7",
"is_secret": true,
"is_verified": false,
"line_number": 60,
"type": "Hex High Entropy String"
"is_secret": true
},
{
"type": "Hex High Entropy String",
"filename": "tests/test_main.py",
"hashed_secret": "186df42ce44b6dc5a79c097baf114cf67eb9a13b",
"is_secret": true,
"is_verified": false,
"line_number": 61,
"type": "Hex High Entropy String"
"is_secret": true
}
]
},
"version": "0.13.1",
"word_list": {
"file": null,
"hash": null
}
"version": "1.2.0",
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
}
]
}
14 changes: 1 addition & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,12 @@ language: python

jobs:
include:
- os: linux
python: "3.6"
- os: linux
python: "3.7"
- os: linux
python: "3.8"
- os: linux
python: "3.9-dev"
python: "3.9"
- os: linux
python: "nightly"
- name: "Python 3.7.7 on macOS 10.14"
os: osx
osx_image: xcode11.2
language: shell
- name: "Python 3.8.5 on macOS 10.14"
os: osx
osx_image: xcode12.2
language: shell

install:
- source .envrc
Expand Down
5 changes: 1 addition & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To contribute to this code, please make sure your system meets the following req

- Unix-like operating system (macOS, Linux, …);
- Load environment variables from [`.envrc`](/.envrc);
- Python 3.6 or above; and
- Python 3.8 or above; and
- Python packages [installed](#installing-python-packages) from the [`requirements.txt`](./requirements.txt) file.

We recommend installing [`direnv`](https://direnv.net/), and its shell hooks to load environment variables from
Expand Down Expand Up @@ -98,9 +98,6 @@ By default, Travis CI will only deploy commits with Git tags. We work on the ass
Git tags are only applied for releases, and vice versa. Tags/releases are named according to [semantic
versioning][semver].

Travis CI builds the application on Linux Python 3.6+, but only macOS Python 3.7-3.8 due to difficulties installing
different Python versions on macOS Travis CI builds. See the [`.travis.yml`](./.travis.yml) for further details.

[application]: https://shields-io-visitor-counter.herokuapp.com
[detect-secrets]: https://github.com/Yelp/detect-secrets
[envfile]: https://plugins.jetbrains.com/plugin/7861-envfile
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![GPL-3.0](https://img.shields.io/github/license/ESKYoung/shields-io-visitor-counter?logo=GNU&logoColor=FFFFFF&style=flat-square)](https://github.com/ESKYoung/shields-io-visitor-counter/blob/main/LICENSE)
[![GitHub release](https://img.shields.io/github/v/release/ESKYoung/shields-io-visitor-counter?logo=GitHub&logoColor=FFFFFF&style=flat-square)](https://github.com/ESKYoung/shields-io-visitor-counter)
[![Python 3.6+](https://img.shields.io/badge/python-3.6+-3776AB?logo=Python&logoColor=FFFFFF&style=flat-square)](https://www.python.org/)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-3776AB?logo=Python&logoColor=FFFFFF&style=flat-square)](https://www.python.org/)
[![Travis CI](https://img.shields.io/travis/com/ESKYoung/shields-io-visitor-counter/main?logo=Travis%20CI&logoColor=FFFFFF&style=flat-square)](https://travis-ci.com/github/ESKYoung/shields-io-visitor-counter)
[![Codecov](https://img.shields.io/codecov/c/github/ESKYoung/shields-io-visitor-counter/main?logo=Codecov&logoColor=FFFFFF&style=flat-square)](https://codecov.io/gh/ESKYoung/shields-io-visitor-counter)
[![Visitor count](https://shields-io-visitor-counter.herokuapp.com/badge?page=ESKYoung.shields-io-visitor-counter&color=1D70B8&logo=GitHub&logoColor=FFFFFF&style=flat-square)](https://github.com/ESKYoung/shields-io-visitor-counter)
Expand Down
2 changes: 0 additions & 2 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[pytest]
addopts = -vv --doctest-modules
doctest_optionflags = NORMALIZE_WHITESPACE
env =
HASH_KEY=pytest
61 changes: 48 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,48 @@
coverage
detect-secrets
flake8
flask
gunicorn
hypothesis
pre-commit
pytest
pytest-env
pytest-mock
pytest-xdist
requests
werkzeug
attrs==21.4.0
certifi==2022.6.15
cfgv==3.3.1
charset-normalizer==2.0.12
click==8.1.3
coverage==6.4.1
detect-secrets==1.2.0
distlib==0.3.4
execnet==1.9.0
filelock==3.7.1
flake8==4.0.1
Flask==2.1.2
gunicorn==20.1.0
hypothesis==5.49.0
identify==2.5.1
idna==3.3
importlib-metadata==4.11.4
iniconfig==1.1.1
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
mccabe==0.6.1
nodeenv==1.6.0
packaging==21.3
platformdirs==2.5.2
pluggy==1.0.0
pre-commit==2.19.0
pre-commit-hooks==4.3.0
py==1.11.0
pycodestyle==2.8.0
pyflakes==2.4.0
pyparsing==3.0.9
pytest==7.1.2
pytest-forked==1.4.0
pytest-mock==3.7.0
pytest-xdist==2.5.0
PyYAML==6.0
requests==2.28.0
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.6
six==1.16.0
sortedcontainers==2.4.0
toml==0.10.2
tomli==2.0.1
urllib3==1.26.9
virtualenv==20.14.1
Werkzeug==2.1.2
zipp==3.8.0
6 changes: 6 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import os
import pytest


def pytest_sessionstart(session):
"""Set environment variables on start of the pytest session."""
os.environ["HASH_KEY"] = "pytest"


@pytest.fixture
def patch_flask_redirect(mocker):
"""Patch the flask.redirect function that has been imported in main.py."""
Expand Down

0 comments on commit 44ad351

Please sign in to comment.