Skip to content

Commit

Permalink
scripts require Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dansan committed Nov 29, 2022
1 parent c1d6822 commit 7b0ef9b
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/code_linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install bandit black isort flake8
python -m pip install -r requirements.txt -r requirements_dev.txt -r requirements_test.txt
python -m pip list
python3 -m pip install --upgrade pip wheel
python3 -m pip install bandit black isort flake8
python3 -m pip install -r requirements.txt -r requirements_dev.txt -r requirements_test.txt
python3 -m pip list
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install pytest-cov
python -m pip install -r requirements.txt -r requirements_dev.txt -r requirements_test.txt
python -m pip list
python3 -m pip install --upgrade pip wheel
python3 -m pip install pytest-cov
python3 -m pip install -r requirements.txt -r requirements_dev.txt -r requirements_test.txt
python3 -m pip list
- name: Install Python package
run: python -m pip install -e .
run: python3 -m pip install -e .
- name: Install yq
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ install:
- UCS_HOST=$(sudo sh -c ". $PWD/lxd.sh; lxd_container_ip") make pip-install-openapi-client
- pip install -U tox-travis

# Command to run tests, e.g. python setup.py test
# Command to run tests, e.g. python3 setup.py test
script: UCS_HOST=$(sudo sh -c ". $PWD/lxd.sh; lxd_container_ip") tox
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Tips

To run a subset of tests::

$ python -m pytest tests/test_base_http.py::test_session_base_dn
$ python3 -m pytest tests/test_base_http.py::test_session_base_dn


Deploying
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ for line in sys.stdin:
endef
export PRINT_HELP_PYSCRIPT

BROWSER := python -c "$$BROWSER_PYSCRIPT"
BROWSER := python3 -c "$$BROWSER_PYSCRIPT"

TEST_CONTAINER_NAME = ucs5
LXD_IMAGE_FILES_EXIST = . ./lxd.sh && lxd_image_files_exists
Expand All @@ -53,7 +53,7 @@ OPENAPI_CLIENT_LIB_IS_INSTALLED = python3 -m pip show -q openapi-client-udm


help:
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)
@python3 -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST)

clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

Expand Down Expand Up @@ -122,7 +122,7 @@ test: ## run tests with the current Python interpreter
echo "Starting UCS using LXD. Set UCS_HOST, UCS_USERDN and UCS_PASSWORD to use an existing UCS server."; \
make create-lxd-test-server-config; \
fi; \
python -m pytest -l -v && rv=0 || rv=1; \
python3 -m pytest -l -v && rv=0 || rv=1; \
echo "Stopping and removing the LXD container..."; \
make stop-and-remove-lxd-container; \
return $$rv
Expand Down Expand Up @@ -180,12 +180,12 @@ release-test: dist ## package and upload a release to the pypi test site
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python3 setup.py sdist
python3 setup.py bdist_wheel
ls -l dist

install: clean ## install the package to the active Python's site-packages
python setup.py develop
python3 setup.py develop

lxd-is-initialized:
@if $(LXD_IS_INITIALIZED); then\
Expand Down Expand Up @@ -289,8 +289,8 @@ upload_openapi-client-to-test-pypi: clean ## build and upload "openapi-client-u
curl -u Administrator:univention http://$$UCS_HOST/univention/udm/openapi.json > /tmp/build/udm_openapi.json
docker run -u "`id -u`:`id -g`" -v /tmp/build:/local $(OPENAPI_GENERATOR_DOCKER_IMAGE) generate -g python-legacy --library asyncio --package-name openapi_client_udm "--additional-properties=packageVersion=$$PACKAGE_VERSION" -i /local/udm_openapi.json -o /local/python
cd /tmp/build/python; \
python setup.py sdist; \
python setup.py bdist_wheel; \
python3 setup.py sdist; \
python3 setup.py bdist_wheel; \
ls -l dist
cd /tmp/build/python; \
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Once you have a copy of the source, you can install it with:

.. code-block:: console
$ python setup.py install
$ python3 setup.py install
.. _Github repo: https://github.com/univention/python-udm-rest-api-client
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ basepython = python3
deps = sphinx
commands_pre = make pip-install-openapi-client
commands = sphinx-build -d "{toxworkdir}/docs_doctree" docs "{toxworkdir}/docs_out" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'
python3 -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxworkdir}") / "docs_out" / "index.html"))'

[travis]
python =
Expand Down

0 comments on commit 7b0ef9b

Please sign in to comment.