Skip to content

Commit 324e808

Browse files
committed
Merge branch 'master' of github.com:dbcli/mycli into tsroten/pin_correct_pep8radius
2 parents 229a38c + e8e6bb4 commit 324e808

23 files changed

+53
-251
lines changed

.coveragerc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[run]
2-
parallel=True
3-
source=mycli
2+
parallel = True
3+
source = mycli

.travis.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ python:
77
- "3.6"
88

99
install:
10-
- pip install PyMySQL . pytest mock codecov pexpect behave
10+
- pip install PyMySQL pytest mock codecov pexpect behave pytest-cov
1111
- pip install git+https://github.com/hayd/pep8radius.git
12+
- pip install -e .
1213

1314
script:
1415
- set -e
15-
- coverage run --source mycli -m py.test
16-
- cd test
17-
- behave
18-
- cd ..
16+
- py.test --cov-report= --cov=mycli
17+
- behave test/features
1918
- ./setup.py lint
2019
- set +e
2120

@@ -29,4 +28,3 @@ notifications:
2928
- YOUR_WEBHOOK_URL
3029
on_success: change # options: [always|never|change] default: always
3130
on_failure: always # options: [always|never|change] default: always
32-
on_start: false # default: false

MANIFEST.in

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
include LICENSE.txt *.md *.rst TODO requirements-dev.txt screenshots/*
2-
include tasks.py conftest.py .coveragerc pytest.ini test tox.ini
1+
include LICENSE.txt *.md *.rst requirements-dev.txt screenshots/*
2+
include tasks.py .coveragerc tox.ini
3+
recursive-include test *.cnf
4+
recursive-include test *.feature
5+
recursive-include test *.py
6+
recursive-include test *.txt

TODO

-10
This file was deleted.

Vagrantfile

-30
This file was deleted.

conftest.py

-13
This file was deleted.

create_deb.sh

-31
This file was deleted.

debian/changelog

-74
This file was deleted.

debian/compat

-1
This file was deleted.

debian/control

-13
This file was deleted.

debian/mycli.triggers

-8
This file was deleted.

debian/postinst

-5
This file was deleted.

debian/postrm

-5
This file was deleted.

debian/rules

-4
This file was deleted.

mycli/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
# Query tuples are used for maintaining history
5757
Query = namedtuple('Query', ['query', 'successful', 'mutating'])
5858

59-
PACKAGE_ROOT = os.path.dirname(__file__)
59+
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
6060

6161
# no-op logging handler
6262
class NullHandler(logging.Handler):

pytest.ini

-2
This file was deleted.

release.py

+15-24
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#!/usr/bin/env python
2+
"""A script to publish a release of mycli to PyPI."""
3+
24
from __future__ import print_function
5+
import io
6+
from optparse import OptionParser
37
import re
4-
import ast
58
import subprocess
69
import sys
7-
from optparse import OptionParser
810

9-
try:
10-
input = raw_input
11-
except NameError:
12-
pass
11+
import click
1312

1413
DEBUG = False
1514
CONFIRM_STEPS = False
@@ -24,9 +23,7 @@ def skip_step():
2423
global CONFIRM_STEPS
2524

2625
if CONFIRM_STEPS:
27-
choice = input("--- Confirm step? (y/N) [y] ")
28-
if choice.lower() == 'n':
29-
return True
26+
return not click.confirm('--- Run this step?', default=True)
3027
return False
3128

3229

@@ -49,29 +46,26 @@ def run_step(*args):
4946

5047

5148
def version(version_file):
52-
_version_re = re.compile(r'__version__\s+=\s+(.*)')
49+
_version_re = re.compile(
50+
r'__version__\s+=\s+(?P<quote>[\'"])(?P<version>.*)(?P=quote)')
5351

54-
with open(version_file, 'rb') as f:
55-
ver = str(ast.literal_eval(_version_re.search(
56-
f.read().decode('utf-8')).group(1)))
52+
with io.open(version_file, encoding='utf-8') as f:
53+
ver = _version_re.search(f.read()).group('version')
5754

5855
return ver
5956

6057

6158
def commit_for_release(version_file, ver):
6259
run_step('git', 'reset')
6360
run_step('git', 'add', version_file)
64-
run_step('git', 'commit', '--message', 'Releasing version %s' % ver)
61+
run_step('git', 'commit', '--message',
62+
'Releasing version {}'.format(ver))
6563

6664

6765
def create_git_tag(tag_name):
6866
run_step('git', 'tag', tag_name)
6967

7068

71-
def register_with_pypi():
72-
run_step('python', 'setup.py', 'register')
73-
74-
7569
def create_distribution_files():
7670
run_step('python', 'setup.py', 'sdist', 'bdist_wheel')
7771

@@ -90,8 +84,7 @@ def push_tags_to_github():
9084

9185
def checklist(questions):
9286
for question in questions:
93-
choice = input(question + ' (y/N) [n] ')
94-
if choice.lower() != 'y':
87+
if not click.confirm('--- {}'.format(question), default=False):
9588
sys.exit(1)
9689

9790

@@ -123,13 +116,11 @@ def checklist(questions):
123116
CONFIRM_STEPS = popts.confirm_steps
124117
DRY_RUN = popts.dry_run
125118

126-
choice = input('Are you sure? (y/N) [n] ')
127-
if choice.lower() != 'y':
119+
if not click.confirm('Are you sure?', default=False):
128120
sys.exit(1)
129121

130122
commit_for_release('mycli/__init__.py', ver)
131-
create_git_tag('v%s' % ver)
132-
register_with_pypi()
123+
create_git_tag('v{}'.format(ver))
133124
create_distribution_files()
134125
push_to_github()
135126
push_tags_to_github()

release_procedure.txt

-14
This file was deleted.

requirements-dev.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
mock
22
pytest
3+
pytest-cov==2.4.0
34
tox
45
twine==1.8.1
56
behave
67
pexpect
78
coverage==4.3.4
89
git+https://github.com/hayd/pep8radius.git@c8aebd0e1d272160896124e104773b97a6249c3e#egg=pep8radius
10+
click==6.7

setup.cfg

+9
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
[bdist_wheel]
22
universal = 1
3+
4+
[tool:pytest]
5+
addopts = --capture=sys
6+
--showlocals
7+
--doctest-modules
8+
--ignore=setup.py
9+
--ignore=mycli/magic.py
10+
--ignore=mycli/packages/parseutils.py
11+
--ignore=test/features

0 commit comments

Comments
 (0)