Verified Commit 295acf01 authored by Markus Shepherd's avatar Markus Shepherd 🙈
Browse files

first version of version_env

parent aacafede
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: '.'
rev: pre-commit
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: say-hello-world
\ No newline at end of file
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
language_version: python3
- repo: local
hooks:
- id: version-env
name: Writing version to .env
description: Reading library __version__ and saving it to .env
entry: pipenv run python -m board_game_scraper.version_env
language: system
always_run: true
pass_filenames: false
- id: say-hello-world
name: Say hi!
description: Just checking in
entry: bg-hello
language: python
# -*- coding: utf-8 -*-
"""TODO."""
import sys
def main():
"""TODO."""
print(sys.argv)
if __name__ == "__main__":
main()
# -*- coding: utf-8 -*-
"""TODO."""
import argparse
import logging
import sys
from .__version__ import __version__
LOGGER = logging.getLogger(__name__)
def _parse_args():
parser = argparse.ArgumentParser(description="TODO.")
parser.add_argument(
"--verbose",
"-v",
action="count",
default=0,
help="log level (repeat for more verbosity)",
)
return parser.parse_args()
def main():
"""TODO."""
args = _parse_args()
logging.basicConfig(
stream=sys.stderr,
level=logging.DEBUG if args.verbose > 0 else logging.INFO,
format="%(asctime)s %(levelname)-8.8s [%(name)s:%(lineno)s] %(message)s",
)
LOGGER.info(args)
with open("VERSION", "w") as f:
f.write(__version__)
if __name__ == "__main__":
main()
......@@ -167,7 +167,6 @@ setup(
"bg-full-merge=board_game_scraper.full_merge:main",
"bg-news=board_game_scraper.news:main",
"bg-pull=board_game_scraper.pubsub_pull:main",
'bg-hello=board_game_scraper.hello:main'
),
},
install_requires=REQUIRED,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment