Skip to content
This repository was archived by the owner on Sep 26, 2022. It is now read-only.
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
13 changes: 7 additions & 6 deletions .github/workflows/check_setup_py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7]
python-version: [3.6]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run convert
uses: dephell/dephell_action@master
with:
dephell-env: convert
- uses: abatilo/actions-poetry@v2.0.0
- name: Run packaging update
run: bash githooks/update_setup_py.sh
- name: Show changes on working copy
run: git status --porcelain=v1 -uno
- name: Show diff on working copy
run: git diff
- name: Check if setup.py changed
run: |
[ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ]
[ -z "$(git status --porcelain=v1 -uno 2>/dev/null)" ]
- name: Check if setup.py works
run: pip install .
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
working-directory: ../integration-test-docker-environment

- name: Poetry run pytest integration tests
run: poetry run pytest tests
run: poetry run pytest tests
33 changes: 28 additions & 5 deletions githooks/update_setup_py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,38 @@ green='\033[0;32m'
no_color='\033[0m'
grey='\033[0;90m'

echo -e "Update setup.py with dephell convert ${grey}(pre-commit hook)${no_color} "

# Jump to the current project's root directory (the one containing
# .git/)
ROOT_DIR=$(git rev-parse --show-cdup)
ROOT_DIR=$(git rev-parse --show-toplevel || echo)
NO_GIT=FALSE
if [ -z "$ROOT_DIR" ]
then
echo "Did not found git repository, using '$PWD' as ROOT_DIR"
NO_GIT=TRUE
ROOT_DIR=$PWD
fi


pushd "$ROOT_DIR" > /dev/null

dephell venv run --env convert
git add setup.py README.rst
echo -e "Generate setup.py ${grey}(pre-commit hook)${no_color}"
if [ -d "dist" ]
then
rm -r "dist"
fi
poetry build > /dev/null
pushd dist > /dev/null
tar_file=$(ls *.tar.gz)
extracted_dir=${tar_file%.tar.gz}
tar -xf $tar_file
cp "$extracted_dir/setup.py" ../setup.py
rm -r "$extracted_dir"
popd > /dev/null

if [ "$NO_GIT" == "FALSE" ]
then
echo -e "Add generated files ${grey}(pre-commit hook)${no_color}"
git add setup.py
fi

popd > /dev/null
8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,3 @@ requests = "^2.24.0"
[tool.poetry.dev-dependencies]
pytest = "^6.1.1"
pytest-cov = "^2.10.1"

[tool.dephell.main]
from = { format = "poetry", path = "pyproject.toml" }
to = { format = "setuppy", path = "setup.py" }

[tool.dephell.convert]
from = { format = "poetry", path = "pyproject.toml" }
command = "dephell deps convert"
30 changes: 30 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['exasol_bucketfs_utils_python']

package_data = \
{'': ['*']}

install_requires = \
['requests>=2.24.0,<3.0.0']

setup_kwargs = {
'name': 'exasol-bucketfs-utils-python',
'version': '0.1.0',
'description': 'BucketFS utilities for the Python programming language',
'long_description': '# BucketFS Utils Python\n\nThis project provides a python library for the Exasol BucketFS system.\n\nFeatures:\n\n* [Uploading a GitHub release to a bucket](#uploading-github-release-to-bucket)\n\n## How to Use It\n\nInstall the package from Github via `pip`:\n \n```\npip install -e git://github.com/exasol/bucketfs-utils-python.git@{ tag name }#egg=exasol-bucketfs-utils-python\n```\n\n## Uploading GitHub Release to Bucket\n\nExample:\n\n```python\nfrom exasol_bucketfs_utils_python.github_release_file_bucketfs_uploader import GithubReleaseFileBucketFSUploader\n\nrelease_uploader = \\\n GithubReleaseFileBucketFSUploader(file_to_download_name="file",\n github_user="user",\n repository_name="repository",\n release_name="latest",\n path_inside_bucket="some/path/")\nrelease_uploader.upload("http://<host>:<port>/<bucket>/", "user", "password")\n```\n\n### Run Time Dependencies\n\n| Dependency | Purpose | License |\n|-------------------------------|----------------------------------|--------------------|\n| [Python 3][python] | Python version 3.6.1 and above | PSF |\n| [Requests][requests] | Allows to send HTTP/1.1 requests | Apache License 2.0 |\n\n\n### Test Dependencies\n\n| Dependency | Purpose | License |\n|-------------------------------|-----------------------------------|-------------------|\n| [Pytest][pytest] | Testing framework | MIT |\n| [Pytest Coverage][pytest-cov] | Tests coverage | MIT |\n\n\n\n[python]: https://docs.python.org\n[requests]: https://pypi.org/project/requests/\n\n[pytest]: https://docs.pytest.org/en/stable/\n[pytest-cov]: https://pypi.org/project/pytest-cov/\n',
'author': 'Torsten Kilias',
'author_email': 'torsten.kilias@exasol.com',
'maintainer': None,
'maintainer_email': None,
'url': 'https://github.com/exasol/bucketfs-utils-python',
'packages': packages,
'package_data': package_data,
'install_requires': install_requires,
'python_requires': '>=3.6.1',
}


setup(**setup_kwargs)