diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3fdec19 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,16 @@ +name: Publish package to PyPI +on: + push: + tags: + - "*.*.*" +jobs: + build: + runs-on: ubuntu-latest + environment: PyPI + steps: + - uses: actions/checkout@v3 + - name: Build and publish to pypi + uses: JRubics/poetry-publish@v1.15 + with: + pypi_token: ${{ secrets.PYPI_API_TOKEN }} + ignore_dev_requirements: "yes" diff --git a/.gitignore b/.gitignore index 9373c58..346591a 100644 --- a/.gitignore +++ b/.gitignore @@ -161,3 +161,5 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ /tests/output/*.* +/pytest.xml +/pytest-coverage.txt diff --git a/demo.ipynb b/demo.ipynb index 7d57fe6..3fdfd6a 100644 --- a/demo.ipynb +++ b/demo.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "0590e9d3-e978-43de-b17d-695b93105143", "metadata": {}, "outputs": [], @@ -12,44 +12,10 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "10374bb7-ed85-47b2-87bf-964436f54786", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/bjornandre/Library/Caches/pypoetry/virtualenvs/dapla-toolbelt-iCf-zdcD-py3.10/lib/python3.10/site-packages/google/auth/_default.py:83: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a \"quota exceeded\" or \"API not enabled\" error. We recommend you rerun `gcloud auth application-default login` and make sure a quota project is added. Or you can use service accounts instead. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n", - " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n" - ] - }, - { - "data": { - "text/plain": [ - "['/airline',\n", - " '/dnscensus2013',\n", - " '/github-data',\n", - " '/iris',\n", - " '/nyc-taxi',\n", - " '/nyc-taxi/2015.parquet',\n", - " '/nyc-taxi/csv',\n", - " '/nyc-taxi/csv/2014',\n", - " '/nyc-taxi/csv/2015',\n", - " '/nyc-taxi/csv/2016',\n", - " '/nyc-taxi/nyc.parquet',\n", - " '/nyc-taxi/taxi.parquet',\n", - " '/orc',\n", - " '/packages',\n", - " '/projects-data',\n", - " '/projects-data/tensorboard']" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Show contents of folder recursively\n", "dp.show('gs://anaconda-public-data')" @@ -57,32 +23,10 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "4d987875-af1b-4c0d-9a6e-2ad16bc3b223", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/bjornandre/Library/Caches/pypoetry/virtualenvs/dapla-toolbelt-iCf-zdcD-py3.10/lib/python3.10/site-packages/google/auth/_default.py:83: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a \"quota exceeded\" or \"API not enabled\" error. We recommend you rerun `gcloud auth application-default login` and make sure a quota project is added. Or you can use service accounts instead. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n", - " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n" - ] - }, - { - "data": { - "text/plain": [ - "[{'Size': 4636,\n", - " 'Name': '/iris/iris.csv',\n", - " 'Created': '2017-04-05T21:51:42.503Z',\n", - " 'Updated': '2017-04-05T21:51:42.503Z'}]" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Show file or folder detalis\n", "dp.details('gs://anaconda-public-data/iris/iris.csv')" @@ -90,162 +34,10 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "c3ce598a-031c-4b40-92a0-36cd44cfd0d9", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/bjornandre/Library/Caches/pypoetry/virtualenvs/dapla-toolbelt-iCf-zdcD-py3.10/lib/python3.10/site-packages/google/auth/_default.py:83: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a \"quota exceeded\" or \"API not enabled\" error. We recommend you rerun `gcloud auth application-default login` and make sure a quota project is added. Or you can use service accounts instead. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n", - " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
petal_lengthsepal_lengthpetal_widthsepal_widthspecies
05.13.51.40.2Iris-setosa
14.93.01.40.2Iris-setosa
24.73.21.30.2Iris-setosa
34.63.11.50.2Iris-setosa
45.03.61.40.2Iris-setosa
..................
1466.73.05.22.3Iris-virginica
1476.32.55.01.9Iris-virginica
1486.53.05.22.0Iris-virginica
1496.23.45.42.3Iris-virginica
1505.93.05.11.8Iris-virginica
\n", - "

151 rows × 5 columns

\n", - "
" - ], - "text/plain": [ - " petal_length sepal_length petal_width sepal_width species\n", - "0 5.1 3.5 1.4 0.2 Iris-setosa\n", - "1 4.9 3.0 1.4 0.2 Iris-setosa\n", - "2 4.7 3.2 1.3 0.2 Iris-setosa\n", - "3 4.6 3.1 1.5 0.2 Iris-setosa\n", - "4 5.0 3.6 1.4 0.2 Iris-setosa\n", - ".. ... ... ... ... ...\n", - "146 6.7 3.0 5.2 2.3 Iris-virginica\n", - "147 6.3 2.5 5.0 1.9 Iris-virginica\n", - "148 6.5 3.0 5.2 2.0 Iris-virginica\n", - "149 6.2 3.4 5.4 2.3 Iris-virginica\n", - "150 5.9 3.0 5.1 1.8 Iris-virginica\n", - "\n", - "[151 rows x 5 columns]" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Read a csv file into a Pandas dataframe\n", "dp.read_pandas('gs://anaconda-public-data/iris/iris.csv', file_format=\"csv\")" @@ -253,26 +45,10 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "b39ea535-f801-445a-b1d7-6dd9013c08da", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/bjornandre/Library/Caches/pypoetry/virtualenvs/dapla-toolbelt-iCf-zdcD-py3.10/lib/python3.10/site-packages/google/auth/_default.py:83: UserWarning: Your application has authenticated using end user credentials from Google Cloud SDK without a quota project. You might receive a \"quota exceeded\" or \"API not enabled\" error. We recommend you rerun `gcloud auth application-default login` and make sure a quota project is added. Or you can use service accounts instead. For more information about service accounts, see https://cloud.google.com/docs/authentication/\n", - " warnings.warn(_CLOUD_SDK_CREDENTIALS_WARNING)\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "b'petal_length,sepal_length,petal_width,sepal_width,species\\n'\n" - ] - } - ], + "outputs": [], "source": [ "from dapla import FileClient\n", "\n",