From 6808ef3ffbc81ea0212cb7f25a11f098356b5e87 Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Mon, 23 Jan 2023 15:59:44 -0500 Subject: [PATCH 01/11] adding test release.yaml file for uploading to testpypi (eventually pypi) --- .github/workflows/release.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..aa5cd75 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,30 @@ +name: Release + +on: + on: + push: + branches: '5-set-up-workflow-to-upload-to-pypi' +# release: +# types: [created] + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.x" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python setup.py sdist bdist_wheel +# twine upload --repository pypi dist/* + twine upload --repository testpypi dist/* \ No newline at end of file From 0fbae02b65578d0e8f2987e4a8a1ec8a336a4a9f Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Mon, 23 Jan 2023 16:19:35 -0500 Subject: [PATCH 02/11] adding testpypi api token variable --- .github/workflows/release.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aa5cd75..2d31549 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -23,7 +23,8 @@ jobs: - name: Build and publish env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} +# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} run: | python setup.py sdist bdist_wheel # twine upload --repository pypi dist/* From 7de62b5c4410f02046046da59c61bd1a43e7fba8 Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Mon, 23 Jan 2023 16:25:05 -0500 Subject: [PATCH 03/11] separate pip install into 3 lines --- .github/workflows/release.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2d31549..1b896ab 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -19,7 +19,9 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install setuptools + pip install wheel + pip install twine - name: Build and publish env: TWINE_USERNAME: __token__ From 8bcdaa62a5d838082158b5303becd9309cae47ed Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 09:33:09 -0500 Subject: [PATCH 04/11] change release.yaml file to use pypa/gh-action-pypi-publish --- .github/workflows/release.yaml | 52 +++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1b896ab..4ffd561 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,4 +1,4 @@ -name: Release +name: PyPI Release on: on: @@ -9,6 +9,7 @@ on: jobs: deploy: + name: Build and publish to PyPI runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -16,18 +17,37 @@ jobs: uses: actions/setup-python@v2 with: python-version: "3.x" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools - pip install wheel - pip install twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ -# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} - run: | - python setup.py sdist bdist_wheel -# twine upload --repository pypi dist/* - twine upload --repository testpypi dist/* \ No newline at end of file + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TESTPYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + +# - name: Install dependencies +# run: | +# python -m pip install --upgrade pip +# pip install setuptools +# pip install wheel +# pip install twine +# - name: Build and publish +# env: +# TWINE_USERNAME: __token__ +## TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} +# TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} +# run: | +# python setup.py sdist bdist_wheel +## twine upload --repository pypi dist/* +# twine upload --repository testpypi dist/* \ No newline at end of file From f3d4520e9bab082dd838db2e17dafa140572702c Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 09:34:59 -0500 Subject: [PATCH 05/11] fix on condition --- .github/workflows/release.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4ffd561..ad33895 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,9 +1,8 @@ name: PyPI Release on: - on: - push: - branches: '5-set-up-workflow-to-upload-to-pypi' + push: + branches: '5-set-up-workflow-to-upload-to-pypi' # release: # types: [created] From 99f1d387af84ee2009c1de427c7f878e21ff718c Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 10:41:21 -0500 Subject: [PATCH 06/11] update python min version and version of nlprov in setup.py --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 43843db..43f4223 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='nlprov', - version='1.0.0', + version='1.0.1', description='A Python package for common Natural Language Processing tasks', long_description=readme, long_description_content_type='text/markdown', @@ -34,5 +34,8 @@ 'Topic :: Scientific/Engineering' ], tests_require=['pytest'], - python_requires='>=3.7' + python_requires='>=3.8' ) + + +# https://github.com/tomchen/example_pypi_package/blob/d50c61f1317c0cc7d1fc8927d666da7355732c61/README.md From 0e2153560ba745c58756441dcc854a7fd310f445 Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 10:52:43 -0500 Subject: [PATCH 07/11] update version to 1.1.0 --- .github/workflows/pythonapp.yml | 2 +- Dockerfile | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index 1a05c37..de8a7bb 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -35,4 +35,4 @@ jobs: - name: Run Packaging Step shell: bash -l {0} run: | - python -m pip install --user --upgrade setuptools wheel && python setup.py sdist bdist_wheel && python -m pip install --user dist/nlprov-1.0.0-py3-none-any.whl && python -m spacy download en_core_web_sm && python nlp_example.py + python -m pip install --user --upgrade setuptools wheel && python setup.py sdist bdist_wheel && python -m pip install --user dist/nlprov-1.1.0-py3-none-any.whl && python -m spacy download en_core_web_sm && python nlp_example.py diff --git a/Dockerfile b/Dockerfile index fcbda52..a21b695 100644 --- a/Dockerfile +++ b/Dockerfile @@ -33,7 +33,7 @@ RUN python -m pip install --user --upgrade setuptools wheel RUN python setup.py sdist bdist_wheel -RUN python -m pip install --user dist/nlprov-1.0.0-py3-none-any.whl +RUN python -m pip install --user dist/nlprov-1.1.0-py3-none-any.whl RUN python -m spacy download en_core_web_sm diff --git a/setup.py b/setup.py index 43f4223..cfae233 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='nlprov', - version='1.0.1', + version='1.1.0', description='A Python package for common Natural Language Processing tasks', long_description=readme, long_description_content_type='text/markdown', From ca481c3184aa4dc0467441a12d1fbc7d5ae4dffb Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 10:57:43 -0500 Subject: [PATCH 08/11] update release.yaml to publish to PyPI --- .github/workflows/release.yaml | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ad33895..938533e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,14 +1,11 @@ name: PyPI Release -on: - push: - branches: '5-set-up-workflow-to-upload-to-pypi' -# release: -# types: [created] + release: + types: [created] jobs: deploy: - name: Build and publish to PyPI + name: Build and publish to PyPI and TestPyPI runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -34,19 +31,8 @@ jobs: with: password: ${{ secrets.TESTPYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ - -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# pip install setuptools -# pip install wheel -# pip install twine -# - name: Build and publish -# env: -# TWINE_USERNAME: __token__ -## TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} -# TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }} -# run: | -# python setup.py sdist bdist_wheel -## twine upload --repository pypi dist/* -# twine upload --repository testpypi dist/* \ No newline at end of file + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} From 2b17b576806ef7f59367d3b6beacfc4afdde9831 Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 10:58:39 -0500 Subject: [PATCH 09/11] fix on release in release.yaml --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 938533e..f12d53f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,5 +1,6 @@ name: PyPI Release +on: release: types: [created] From 5a28666f4712d616e582edd5bade49bce970cb35 Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 11:05:35 -0500 Subject: [PATCH 10/11] update python version in more places --- .github/workflows/pythonapp.yml | 2 +- README.md | 2 +- dev_environment.yml | 2 +- setup.py | 2 +- tutorial.ipynb | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index de8a7bb..c3f83e7 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -20,7 +20,7 @@ jobs: with: activate-environment: nlp_env environment-file: dev_environment.yml - python-version: 3.7 + python-version: 3.8 auto-activate-base: false - name: Run Unit Tests shell: bash -l {0} diff --git a/README.md b/README.md index 0def4fa..f25fbe0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A tutorial on how to use this package can be found [here](tutorial.ipynb). ## Installation Instructions - - Using pip with Python version 3.7 or higher: + - Using pip with Python version 3.8 or higher: ```shell pip install nlprov ``` diff --git a/dev_environment.yml b/dev_environment.yml index a2de0f0..29ee334 100644 --- a/dev_environment.yml +++ b/dev_environment.yml @@ -6,7 +6,7 @@ dependencies: - pandas>=1.0.0 - pip - pycodestyle=2.5.0 - - python=3.7.* + - python=3.8.* - spacy=3.4.* - spacy-model-en_core_web_sm=3.4.* - pytest=4.4.* diff --git a/setup.py b/setup.py index cfae233..e7a8ebf 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ 'Intended Audience :: Education', 'Intended Audience :: Healthcare Industry', 'Intended Audience :: Information Technology', - 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Scientific/Engineering' ], tests_require=['pytest'], diff --git a/tutorial.ipynb b/tutorial.ipynb index 0c36e7d..280eceb 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -394,7 +394,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.5" + "version": "3.8.5" }, "pycharm": { "stem_cell": { @@ -408,4 +408,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} +} \ No newline at end of file From 21fce9b865b062234a3832343ce67aa59e5eb2b2 Mon Sep 17 00:00:00 2001 From: Sara von Hein Shaw Date: Tue, 24 Jan 2023 13:38:57 -0500 Subject: [PATCH 11/11] revert python version back to 3.7 --- .github/workflows/pythonapp.yml | 2 +- README.md | 2 +- dev_environment.yml | 2 +- setup.py | 4 ++-- tutorial.ipynb | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index c3f83e7..de8a7bb 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -20,7 +20,7 @@ jobs: with: activate-environment: nlp_env environment-file: dev_environment.yml - python-version: 3.8 + python-version: 3.7 auto-activate-base: false - name: Run Unit Tests shell: bash -l {0} diff --git a/README.md b/README.md index f25fbe0..0def4fa 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ A tutorial on how to use this package can be found [here](tutorial.ipynb). ## Installation Instructions - - Using pip with Python version 3.8 or higher: + - Using pip with Python version 3.7 or higher: ```shell pip install nlprov ``` diff --git a/dev_environment.yml b/dev_environment.yml index 29ee334..a2de0f0 100644 --- a/dev_environment.yml +++ b/dev_environment.yml @@ -6,7 +6,7 @@ dependencies: - pandas>=1.0.0 - pip - pycodestyle=2.5.0 - - python=3.8.* + - python=3.7.* - spacy=3.4.* - spacy-model-en_core_web_sm=3.4.* - pytest=4.4.* diff --git a/setup.py b/setup.py index e7a8ebf..4ab5756 100644 --- a/setup.py +++ b/setup.py @@ -30,11 +30,11 @@ 'Intended Audience :: Education', 'Intended Audience :: Healthcare Industry', 'Intended Audience :: Information Technology', - 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.7', 'Topic :: Scientific/Engineering' ], tests_require=['pytest'], - python_requires='>=3.8' + python_requires='>=3.7' ) diff --git a/tutorial.ipynb b/tutorial.ipynb index 280eceb..538bac8 100644 --- a/tutorial.ipynb +++ b/tutorial.ipynb @@ -394,7 +394,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.5" + "version": "3.7.5" }, "pycharm": { "stem_cell": {