Skip to content

Commit 10ba852

Browse files
authored
🔥 suppress pip install output. #378 (#379)
* 🔥 suppress pip install output. #378 * 💄 update coding style * prepare for release
1 parent 1652919 commit 10ba852

File tree

12 files changed

+51
-26
lines changed

12 files changed

+51
-26
lines changed

.moban.cd/changelog.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: moban
22
organisation: moremoban
33
releases:
4+
- changes:
5+
- action: Fixed
6+
details:
7+
- "`#378`: suppress stdout message from deprecated pip install.
8+
but please do not use and migrate deprecated`requires` syntax."
9+
date: 13.5.2020
10+
version: 0.7.4
411
- changes:
512
- action: Added
613
details:

.moban.cd/moban.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ organisation: moremoban
44
author: C. W.
55
66
license: MIT
7-
version: 0.7.3
8-
current_version: 0.7.3
9-
release: 0.7.3
7+
version: 0.7.4
8+
current_version: 0.7.4
9+
release: 0.7.4
1010
branch: master
1111
master: index
1212
command_line_interface: "moban"

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Change log
22
================================================================================
33

4+
0.7.4 - 13.5.2020
5+
--------------------------------------------------------------------------------
6+
7+
**Fixed**
8+
9+
#. `#378 <https://github.com/moremoban/moban/issues/378>`_: suppress stdout
10+
message from deprecated pip install. but please do not use and migrate
11+
deprecated`requires` syntax.
12+
413
0.7.3 - 2.5.2020
514
--------------------------------------------------------------------------------
615

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
copyright = '2017-2020 Onni Software Ltd.'
2626
author = 'C. W.'
2727
# The short X.Y version
28-
version = '0.7.3'
28+
version = '0.7.4'
2929
# The full version, including alpha/beta/rc tags
30-
release = '0.7.3'
30+
release = '0.7.4'
3131

3232
# -- General configuration ---------------------------------------------------
3333

moban/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "0.7.3"
1+
__version__ = "0.7.4"
22
__author__ = "C. W."

moban/core/moban_factory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def get_engine(self, template_type, template_dirs, context_dirs):
4949
template_dirs = utils.verify_the_existence_of_directories(
5050
template_dirs
5151
)
52-
5352
if template_type in self.options_registry:
53+
5454
custom_engine_spec = self.options_registry[template_type]
5555
engine_cls = self.load_me_now(
5656
custom_engine_spec[constants.TEMPLATE_TYPES_BASE_TYPE]

moban/deprecated/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ def pip_install(packages):
6565
import subprocess
6666

6767
subprocess.check_call(
68-
[sys.executable, "-m", "pip", "install", " ".join(packages)]
68+
[sys.executable, "-m", "pip", "install", " ".join(packages)],
69+
stdout=subprocess.DEVNULL,
70+
stderr=subprocess.DEVNULL,
6971
)
7072

7173

moban/externals/reporter.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
def report_templating(
1818
action_in_present_continuous_tense, source_file, destination_file
1919
):
20-
print(
20+
do_print(
2121
MESSAGE_TEMPLATING.format(
2222
action_in_present_continuous_tense,
2323
crayons.yellow(source_file),
@@ -27,36 +27,36 @@ def report_templating(
2727

2828

2929
def report_no_action():
30-
print(crayons.yellow(MESSAGE_NO_TEMPLATING, bold=True))
30+
do_print(crayons.yellow(MESSAGE_NO_TEMPLATING, bold=True))
3131

3232

3333
def report_full_run(action_in_past_tense, file_count):
3434
figure = crayons.green(str(file_count), bold=True)
3535
message = MESSAGE_TEMPLATED_ALL.format(action_in_past_tense, figure)
36-
print(_format_single(message, file_count))
36+
do_print(_format_single(message, file_count))
3737

3838

3939
def report_partial_run(action_in_past_tense, file_count, total):
4040
figure = crayons.green(str(file_count), bold=True)
4141
total_figure = crayons.yellow(str(total), bold=True)
4242
message = MESSAGE_REPORT.format(action_in_past_tense, figure, total_figure)
43-
print(_format_single(message, total))
43+
do_print(_format_single(message, total))
4444

4545

4646
def report_error_message(message):
47-
print(crayons.white("Error: ", bold=True) + crayons.red(message))
47+
do_print(crayons.white("Error: ", bold=True) + crayons.red(message))
4848

4949

5050
def report_warning_message(message):
51-
print(crayons.white("Warning: ", bold=True) + crayons.yellow(message))
51+
do_print(crayons.white("Warning: ", bold=True) + crayons.yellow(message))
5252

5353

5454
def report_info_message(message):
55-
print(crayons.white("Info: ") + crayons.green(message))
55+
do_print(crayons.white("Info: ") + crayons.green(message))
5656

5757

5858
def report_up_to_date():
59-
print(crayons.green(MESSAGE_UP_TO_DATE, bold=True))
59+
do_print(crayons.green(MESSAGE_UP_TO_DATE, bold=True))
6060

6161

6262
def convert_to_shell_exit_code(number_of_templated_files):
@@ -69,12 +69,12 @@ def convert_to_shell_exit_code(number_of_templated_files):
6969

7070
def report_git_pull(repo):
7171
colored_repo = crayons.green(repo, bold=True)
72-
print(MESSAGE_PULLING_REPO.format(colored_repo))
72+
do_print(MESSAGE_PULLING_REPO.format(colored_repo))
7373

7474

7575
def report_git_clone(repo):
7676
colored_repo = crayons.green(repo, bold=True)
77-
print(MESSAGE_CLONING_REPO.format(colored_repo))
77+
do_print(MESSAGE_CLONING_REPO.format(colored_repo))
7878

7979

8080
def report_template_not_in_moban_file(template):
@@ -90,3 +90,7 @@ def _format_single(message, count):
9090

9191
def report_file_extension_not_needed():
9292
report_info_message(MESSAGE_FILE_EXTENSION_NOT_NEEDED)
93+
94+
95+
def do_print(message):
96+
print(message)

moban/plugins/jinja2/engine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ def __init__(self, template_fs, options=None):
8686
], # get a copy of this global variable
8787
)
8888
self.template_loader = template_loader
89+
8990
if options:
9091
if "extensions" in options:
9192
extensions = options.pop("extensions")

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
NAME = "moban"
4343
AUTHOR = "C. W."
44-
VERSION = "0.7.3"
44+
VERSION = "0.7.4"
4545
4646
LICENSE = "MIT"
4747
ENTRY_POINTS = {
@@ -53,7 +53,7 @@
5353
"General purpose static text generator"
5454
)
5555
URL = "https://github.com/moremoban/moban"
56-
DOWNLOAD_URL = "%s/archive/0.7.3.tar.gz" % URL
56+
DOWNLOAD_URL = "%s/archive/0.7.4.tar.gz" % URL
5757
FILES = ["README.rst", "CONTRIBUTORS.rst", "CHANGELOG.rst"]
5858
KEYWORDS = [
5959
"python",
@@ -96,8 +96,8 @@
9696
}
9797
# You do not need to read beyond this line
9898
PUBLISH_COMMAND = "{0} setup.py sdist bdist_wheel upload -r pypi".format(sys.executable)
99-
GS_COMMAND = ("gs moban v0.7.3 " +
100-
"Find 0.7.3 in changelog for more details")
99+
GS_COMMAND = ("gs moban v0.7.4 " +
100+
"Find 0.7.4 in changelog for more details")
101101
NO_GS_MESSAGE = ("Automatic github release is disabled. " +
102102
"Please install gease to enable it.")
103103
UPLOAD_FAILED_MSG = (

0 commit comments

Comments
 (0)