Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 11 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ orbs:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "requirements/development.py3.txt" }}
- v1-dependencies-{{ checksum "requirements.txt" }}
- v1-dependencies-
- run:
name: Install dependencies
command: |
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements/development.py3.txt
pip install -r requirements.txt
- when:
condition: <<parameters.is_test_suite>>
steps:
Expand All @@ -78,7 +78,7 @@ orbs:
- save_cache:
paths:
- .venv
key: v1-dependencies-{{ checksum "requirements/development.py3.txt" }}
key: v1-dependencies-{{ checksum "requirements.txt" }}
- run:
name: Run <<parameters.service_name>>
command: |
Expand All @@ -104,7 +104,7 @@ orbs:
executors:
cloudsmith_executor:
docker:
- image: circleci/python:3.6.1
- image: circleci/python:3.8


workflows:
Expand All @@ -113,15 +113,19 @@ workflows:
- cloudsmith_ci/execute:
name: isort
service_name: isort
command: isort -rc -c
command: pre-commit run -a isort
- cloudsmith_ci/execute:
name: black
service_name: black
command: black --check .
command: pre-commit run -a black
- cloudsmith_ci/execute:
name: flake8
service_name: flake8
command: flake8
command: pre-commit run -a flake8
- cloudsmith_ci/execute:
name: pyupgrade
service_name: pyupgrade
command: pre-commit run -a pyupgrade
- cloudsmith_ci/execute:
name: pylint
service_name: pylint
Expand Down
5 changes: 0 additions & 5 deletions .codacy.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copy this file to a file named .env
# Filling in the various values will allow pytest to execute more of the test suite.
PYTEST_CLOUDSMITH_API_HOST=
PYTEST_CLOUDSMITH_API_KEY=
PYTEST_CLOUDSMITH_ORGANIZATION=
PYTEST_CLOUDSMITH_PASSWORD=
PYTEST_CLOUDSMITH_USERNAME=
30 changes: 13 additions & 17 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
has virtualenv && {
(test -d .venv/py2 && test -d .venv/py3) || {
mkdir -p .venv
set -e

test -d .venv/py2 || {
virtualenv -p python2.7 .venv/py2 --no-site-packages
.venv/py2/bin/pip install -r requirements/development.py2.txt
.venv/py2/bin/pip install --upgrade pip &>/dev/null
}
# This uses a combination of direnv + pyenv to
# create and activate a virtual environment, and install
# development dependencies. Based on:
# https://hynek.me/til/python-project-local-venvs/
export VIRTUAL_ENV=.venv
layout pyenv 3.8.16
. .venv/bin/activate
python -m pip install -r requirements.txt

test -d .venv/py3 || {
virtualenv -p python3.6 .venv/py3 --no-site-packages
source .venv/py3/bin/activate
.venv/py3/bin/pip install -r requirements/development.py3.txt
.venv/py3/bin/pip install --upgrade pip &>/dev/null
}
}
# Load environment variables from the .env file (for pytest, mainly)
dotenv

source .venv/py3/bin/activate
}
# Install pre-commit hooks
pre-commit install

# Python
export PYTHONDONTWRITEBYTECODE=1
Expand Down
3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[flake8]
exclude = .svn,CVS,.bzr,.hg,.git,__pycache,.venv,migrations,settings,tests,.tox,build
max-complexity = 20
max-line-length = 88
max-line-length = 100
select = C,E,F,W,B,B950
ignore = E203,E501,D107,D102,W503
per-file-ignores = __init__.py:F401
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ reports/

# Jetbrains IDEs
.idea

# dotenv
.env
67 changes: 37 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,30 @@
# See: https://pre-commit.com/hooks.html
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
rev: v4.4.0
hooks:
- id: debug-statements
- id: end-of-file-fixer
exclude: >
(?x)^(
\.bumpversion\.cfg
)$
- id: check-merge-conflict
- id: check-added-large-files
- id: check-ast
- id: check-byte-order-marker
- id: check-builtin-literals
- id: check-byte-order-marker
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: detect-aws-credentials
args: ['--allow-missing-credentials']
- id: detect-private-key
exclude: >
(?x)^(
.bumpversion.cfg
)$
- id: fix-encoding-pragma
- id: end-of-file-fixer
exclude: >
(?x)^(
\.bumpversion\.cfg
)$
- id: forbid-new-submodules
- id: trailing-whitespace
- id: name-tests-test
args: ['--django']
exclude: >
Expand All @@ -41,30 +39,39 @@ repos:
cloudsmith_cli/.*/tests/utils\.py|
cloudsmith/.*/tests/views\.py
)$
- id: flake8
exclude: >
(?x)^(
cloudsmith/.*/tests/.*|
cloudsmith/.*/migrations/.*|
cloudsmith/settings/.*
)$
args: ['--config=.flake8']
language_version: python3.6
- id: trailing-whitespace

- repo: https://github.com/ambv/black
rev: 19.3b0
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.6

- repo: https://github.com/asottile/seed-isort-config
rev: v1.7.0
- repo: https://github.com/pycqa/flake8
rev: '4.0.1'
hooks:
- id: seed-isort-config
language_version: python3.6
- id: flake8
args: ['--config=.flake8']

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.15
- repo: https://github.com/pycqa/isort
rev: 5.11.5
hooks:
- id: isort
language_version: python3.6

- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args:
[
"-rn", # Only display messages
"-sn", # Don't display the score
"--rcfile=.pylintrc", # Link to your config file
]
Loading