Commit a5313541 authored by David Danier's avatar David Danier

Merge branch 'master' into autocreate-external-networks

parents 7d0c97c6 c38cc3f7
......@@ -2,9 +2,9 @@ stages:
- test
pytest:
image: python:3.7
image: python:3.8
stage: test
script:
- pip install pipenv
- pipenv install --system --dev
- pytest b5/tests -v
- pip install poetry
- poetry install
- poetry run pytest b5/tests -v
......@@ -2,6 +2,18 @@
* work in progress ;-)
# 1.1.6
* dephell did not convert console_scripts, readding this to pyproject.toml
# 1.1.5
* Use poetry for package management
* Included first test + linting
* Rewrite of argument parsing
* Better support for detecting how to clone skel repositories
* Support Python 3.8
# 1.1.4
* Docker sync config allows to specify `auto: false` to not automatically sync on `docker:update` and `docker:sync`,
......
Copyright (c) 2016-2017
Copyright (c) 2016-2020
TEAM23 GmbH <info@team23.de> / David Danier <danier@team23.de>
All rights reserved.
......
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
pyyaml = "~=5.1"
termcolor = "~=1.1.0"
"jinja2" = "~=2.10"
markupsafe = "~=1.1"
packaging = ">=16.0"
[dev-packages]
"e1839a8" = {path = ".", editable = true}
pylint = ">=2.3.1"
pytest = ">=5.3.2"
[requires]
python_version = "3.7"
This diff is collapsed.
import os
VERSION = '1.1.5-dev'
VERSION = '1.1.8-dev'
B5_PATH = os.path.realpath(os.path.dirname(__file__))
B5_BASH_PATH = os.path.join(B5_PATH, 'bash')
B5_TEMPLATES_PATH = os.path.join(B5_PATH, 'templates')
......@@ -4,15 +4,15 @@ import sys
import termcolor
from .lib.argumentparser import MainArgumentParser
from . import VERSION
from .exceptions import B5ExecutionError
from .lib.config import find_configs
from .lib.config import load_config
from .lib.detect import detect_project_path
from .lib.script import StoredScriptSource, construct_script_source, construct_script_run
from .lib.state import State
from .lib.taskfile import find_taskfiles
from b5.lib.argumentparser import MainArgumentParser
from b5 import VERSION
from b5.exceptions import B5ExecutionError
from b5.lib.config import find_configs
from b5.lib.config import load_config
from b5.lib.detect import detect_project_path
from b5.lib.script import StoredScriptSource, construct_script_source, construct_script_run
from b5.lib.state import State
from b5.lib.taskfile import find_taskfiles
def main():
......@@ -86,3 +86,6 @@ def main():
except B5ExecutionError as error:
termcolor.cprint(str(error), 'red')
sys.exit(1)
if __name__ == '__main__':
main()
\ No newline at end of file
import re
from ..lib.config import merge_config
from b5.lib.config import merge_config
CONFIG_PREFIX_RE = re.compile('[^A-Z0-9]')
MODULES = {
......@@ -33,7 +33,7 @@ class BaseModule:
pass
def _script_config_vars(self):
from ..lib.script import config_script_source
from b5.lib.script import config_script_source
return config_script_source(self.config, prefix=CONFIG_PREFIX_RE.sub('_', self.name.upper()))
......
import shlex
import os
from . import BaseModule
from b5.modules import BaseModule
class ComposerModule(BaseModule):
......
......@@ -3,8 +3,8 @@ import os
import pwd
import warnings
from ..exceptions import B5ExecutionError
from . import BaseModule, CONFIG_PREFIX_RE
from b5.exceptions import B5ExecutionError
from b5.modules import BaseModule, CONFIG_PREFIX_RE
class DockerModule(BaseModule):
......
import os
import shlex
from .. import B5_PATH
from . import BaseModule
from b5 import B5_PATH
from b5.modules import BaseModule
class LegacyModule(BaseModule):
......
import shlex
import os
from . import BaseModule
from b5.modules import BaseModule
class NpmModule(BaseModule):
......
import shlex
import os
from . import BaseModule
from b5.modules import BaseModule
class PipenvModule(BaseModule):
......
......@@ -4,9 +4,9 @@ import sys
import termcolor
import jinja2
from ..lib.argumentparser import TemplateArgumentParser
from .. import VERSION
from . import BaseModule
from b5.lib.argumentparser import TemplateArgumentParser
from b5 import VERSION
from b5.modules import BaseModule
class TemplateModule(BaseModule):
......
import shlex
import os
from . import BaseModule
from b5.modules import BaseModule
class VirtualenvModule(BaseModule):
......
#!/usr/bin/env bash
# b5 Taskfile, see https://git.team23.de/build/b5 for details
pkg:poetry() {
(
cd .. &&
poetry "$@"
)
}
task:install() {
pipenv:install
pkg:poetry install
}
task:update() {
pipenv:update
pkg:poetry install
}
task:b5() {
# Runs the dev version of b5 inside the virtualenv
# Use Taskfile.local and local.yml for testing
pipenv:run b5 "$@"
pkg:poetry run b5 "$@"
}
task:b5-init() {
# Runs the dev version of b5 inside the virtualenv
# Use Taskfile.local and local.yml for testing
pipenv:run b5-init "$@"
pkg:poetry run b5-init "$@"
}
task:shell() {
(
source "$( pipenv:pipenv --venv )/bin/activate"
source "$( pkg:poetry env info -p )/bin/activate"
echo -e "${B5_FONT_GREEN}Starting ${SHELL:-/bin/zsh} in a new virtualenv environment, happy developing${B5_FONT_RESTORE}"
${SHELL:-/bin/zsh} "$@"
)
}
task:pypi:release() {
(
cd .. && \
python3 setup.py sdist && \
twine upload dist/*
)
pkg:poetry build && \
pkg:poetry publish
}
task:lint() {
(
cd .. && \
pipenv:run pylint --rcfile=pylintrc --exit-zero b5/
)
pkg:poetry run pylint --rcfile=pylintrc --exit-zero b5/
}
task:test() {
(
cd .. && \
pipenv:run pytest b5/tests -v
)
pkg:poetry run pytest b5/tests -v
}
......@@ -4,6 +4,3 @@ project:
key: b5
url: https://git.team23.de/build/b5
paths: # None necessary
modules:
pipenv:
base_path: ..
This diff is collapsed.
[tool]
[tool.poetry]
name = "b5"
version = "1.1.8"
description = "b5 - simple and sane task runner"
authors = ["David Danier <danier@team23.de>"]
maintainers = ["David Danier <danier@team23.de>"]
license = "MIT"
readme = "README.md"
homepage = "https://github.com/team23/b5"
repository = "https://github.com/team23/b5"
documentation = "https://github.com/team23/b5/tree/master/docs"
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development',
'Topic :: Software Development :: Build Tools',
'Topic :: System :: Systems Administration',
]
[tool.poetry.dependencies]
python = ">=3.4"
jinja2 = "==2.*,>=2.10.0"
markupsafe = "==1.*,>=1.1.0"
packaging = ">=16.0"
pyyaml = "==5.*,>=5.1.0"
termcolor = "==1.1.*,>=1.1.0"
[tool.poetry.dev-dependencies]
pylint = ">=2.3.1"
pytest = ">=5.3.2"
[tool.poetry.scripts]
b5 = 'b5.main:main'
b5-init = 'b5.init:main'
b5-execute = 'b5.execute:main'
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
#!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
import re
_ABSOLUTE_DOC_LINK = re.compile('\[(?P<text>[^\]]+)\]\((?P<link>docs/[^\)]+)\)')
def _absolute_docs_link_replacement(text):
def _replacement(m):
return '[{text}](https://github.com/team23/b5/blob/master/{link})'.format(
text=m.group('text'),
link=m.group('link')
)
return _ABSOLUTE_DOC_LINK.sub(_replacement, text)
# read the contents of your README file
package_path = path.abspath(path.dirname(__file__))
with open(path.join(package_path, 'README.md'), encoding='utf-8') as f:
long_description = _absolute_docs_link_replacement(f.read())
setup(
name='b5',
version='1.1.4',
description='b5 - simple and sane task runner',
long_description=long_description,
long_description_content_type='text/markdown',
author='David Danier',
author_email='danier@team23.de',
url='https://github.com/team23/b5',
packages=find_packages(exclude=['tests.*', 'tests']),
package_data = {
'b5': [
'bash/*',
'legacy/*',
'legacy/modules/*',
],
},
install_requires=[
'pyyaml ~=5.1',
'termcolor ~=1.1.0',
'Jinja2 ~=2.10',
'MarkupSafe ~=1.1',
'packaging >=16.0',
],
entry_points={
'console_scripts': [
'b5 = b5.main:main',
'b5-init = b5.init:main',
'b5-execute = b5.execute:main',
]
},
zip_safe=False,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Unix',
'Operating System :: POSIX',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
#'Programming Language :: Python :: 3.8',
'Topic :: Software Development',
'Topic :: Software Development :: Build Tools',
'Topic :: System :: Systems Administration',
],
)
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