Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove hard-coded master branch reference #15

Merged
merged 5 commits into from
Dec 14, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ jobs:
fail-fast: false
matrix:
python-version:
- 3.7
- 3.8
- 3.9
- '3.10'
- '3.11'
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
85 changes: 3 additions & 82 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -65,86 +65,7 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
bad-inline-option,
locally-disabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
use-symbolic-message-instead,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
logging-fstring-interpolation,
disable=logging-fstring-interpolation,
missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
Expand Down Expand Up @@ -594,5 +515,5 @@ min-public-methods=2

# Exceptions that will emit a warning when being caught. Defaults to
# "BaseException, Exception".
overgeneral-exceptions=BaseException,
Exception
overgeneral-exceptions=builtins.BaseException,
builtins.Exception
9 changes: 7 additions & 2 deletions pydc_control/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,14 @@ def run_checkout(args: argparse.Namespace):
continue

if os.path.exists(project.path):
log.get_logger().info(f'########### {project.name} (pulling changes) ###########')
commands = ['git', 'pull', 'upstream', 'master']
cwd = project.path
head_branch = subprocess.check_output(
['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
encoding='utf8',
cwd=cwd,
).strip()
log.get_logger().info(f'########### {project.name} (pulling changes for {head_branch}) ###########')
commands = ['git', 'pull', 'upstream', head_branch]
else:
log.get_logger().info(f'########### {project.name} (cloning) ###########')
commands = ['git', 'clone', '--origin', 'upstream', project.repository]
Expand Down
2 changes: 1 addition & 1 deletion pydc_control/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def is_port_open(port):

def _is_path_responding(port: int, path: str) -> bool:
with contextlib.suppress(Exception):
return requests.get(f'http://localhost:{port}{path}').status_code == 200
return requests.get(f'http://localhost:{port}{path}', timeout=30).status_code == 200


def check_port(container_name: str, port: int, path: str) -> None:
Expand Down
1 change: 1 addition & 0 deletions pydc_control/test/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def _run_control_commands(args: List[str], working_dir: Optional[str] = None) ->
os.chdir(working_dir)
exit_code = pydc_control.run(SAMPLE_CONTROL_BASE_DIR, args=args)
if exit_code:
# pylint: disable=broad-exception-raised
raise Exception(f'Could not startup sample project due to exit code: {exit_code}')
if working_dir:
os.chdir(original_working_dir)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import subprocess


MAJOR_VERSION = '1'
MAJOR_VERSION = '2'


version_file = os.path.join(os.path.dirname(__file__), 'pydc_control/VERSION')
Expand Down
9 changes: 9 additions & 0 deletions test_requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pytest>=6.2.4
pytest-randomly>=3.10.1
pytest-cov>=2.12.1
pylint>=2.16.2
pylintfileheader>=0.3.0
pycodestyle>=2.8.0
# Lock major version only
docker<7
tox-pyenv
128 changes: 119 additions & 9 deletions test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,119 @@
pytest==6.2.4
pytest-randomly==3.10.1
pytest-cov==2.12.1
pylint==2.10.2
pylintfileheader==0.3.0
pycodestyle==2.8.0
# Lock major version only
docker<6
tox-pyenv
#
# This file is autogenerated by pip-compile with python 3.7
# To update, run:
#
# pip-compile test_requirements.in
#
astroid==2.15.8
# via pylint
cachetools==5.3.2
# via tox
certifi==2023.11.17
# via requests
chardet==5.2.0
# via tox
charset-normalizer==3.3.2
# via requests
colorama==0.4.6
# via tox
coverage[toml]==7.2.7
# via pytest-cov
dill==0.3.7
# via pylint
distlib==0.3.8
# via virtualenv
docker==6.1.3
# via -r test_requirements.in
exceptiongroup==1.2.0
# via pytest
filelock==3.12.2
# via
# tox
# virtualenv
idna==3.6
# via requests
importlib-metadata==6.7.0
# via
# pluggy
# pytest
# pytest-randomly
# tox
# virtualenv
iniconfig==2.0.0
# via pytest
isort==5.11.5
# via pylint
lazy-object-proxy==1.9.0
# via astroid
mccabe==0.7.0
# via pylint
packaging==23.2
# via
# docker
# pyproject-api
# pytest
# tox
platformdirs==4.0.0
# via
# pylint
# tox
# virtualenv
pluggy==1.2.0
# via
# pytest
# tox
pycodestyle==2.10.0
# via -r test_requirements.in
pylint==2.17.7
# via
# -r test_requirements.in
# pylintfileheader
pylintfileheader==0.3.3
# via -r test_requirements.in
pyproject-api==1.5.3
# via tox
pytest==7.4.3
# via
# -r test_requirements.in
# pytest-cov
# pytest-randomly
pytest-cov==4.1.0
# via -r test_requirements.in
pytest-randomly==3.12.0
# via -r test_requirements.in
requests==2.31.0
# via docker
tomli==2.0.1
# via
# coverage
# pylint
# pyproject-api
# pytest
# tox
tomlkit==0.12.3
# via pylint
tox==4.8.0
# via tox-pyenv
tox-pyenv==1.1.0
# via -r test_requirements.in
typed-ast==1.5.5
# via astroid
typing-extensions==4.7.1
# via
# astroid
# importlib-metadata
# platformdirs
# pylint
# tox
urllib3==2.0.7
# via
# docker
# requests
virtualenv==20.25.0
# via tox
websocket-client==1.6.1
# via docker
wrapt==1.16.0
# via astroid
zipp==3.15.0
# via importlib-metadata
Loading