From f9a10ad5eea447db079fd4240d42df2ed10c10a8 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 20:00:37 +0300 Subject: [PATCH 01/18] Use pip (not conda) to install khoj, run pytest in Github Workflow --- .github/workflows/test.yml | 55 ++++++++++++-------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18e17526..963608cb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,50 +22,29 @@ on: jobs: test: + runs-on: ubuntu-latest strategy: matrix: - include: - - os: ubuntu-latest - label: linux-64 - prefix: /usr/share/miniconda3/envs/test + python-version: ["3.7", "3.8", "3.9", "3.10"] - name: ${{ matrix.label }} - runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Install Environment Dependencies + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install System Dependencies shell: bash -l {0} run: sudo apt-get -y install libimage-exiftool-perl - - name: Setup Mambaforge - uses: conda-incubator/setup-miniconda@v2 - with: - miniforge-variant: Mambaforge - miniforge-version: latest - activate-environment: test - use-mamba: true - environment-file: config/environment.yml - python-version: 3.8 - auto-activate-base: false - use-only-tar-bz2: true + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + pip install -upgrade . - - name: Set cache date - run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV - - - uses: actions/cache@v2 - with: - path: ${{ matrix.prefix }} - key: ${{ matrix.label }}-conda-${{ hashFiles('config/environment.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} - env: - # Increase this value to reset cache if environment.yml has not changed - CACHE_NUMBER: 0 - id: cache - - - name: Update environment - run: mamba env update -n test -f config/environment.yml - if: steps.cache.outputs.cache-hit != 'true' - - - name: Run Pytest - shell: bash -l {0} - run: python -m pytest + - name: Test with pytest + run: | + pytest \ No newline at end of file From d42203d29e31216aa2cea4e06cf4dc90d1f72a29 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 20:20:34 +0300 Subject: [PATCH 02/18] Fix --upgrade flag to pip install command in Test Github Workflow --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 963608cb..9e2e9493 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,7 +43,7 @@ jobs: run: | python -m pip install --upgrade pip pip install pytest - pip install -upgrade . + pip install --upgrade . - name: Test with pytest run: | From 5d391fdcbed83770c4ee157f7aa96d4c579a29e5 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 20:25:15 +0300 Subject: [PATCH 03/18] Just use Python version 3.10 in test Github Workflow --- .github/workflows/test.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e2e9493..8fe63c6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,17 +23,14 @@ on: jobs: test: runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.10 uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: '3.10' - name: Install System Dependencies shell: bash -l {0} From e76930b32014469a5c3ed868e88b03c56d97b31a Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 21:47:53 +0300 Subject: [PATCH 04/18] Set minimum python version to 3.8 as required by dependencies --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3020af17..b3787d4c 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( url='https://github.com/debanjum/khoj', license="GPLv3", keywords="search semantic-search productivity NLP org-mode markdown beancount images", - python_requires=">=3.5, <4", + python_requires=">=3.8, <4", packages=find_packages( where=".", exclude=["tests*"], From 92016eb49cb5dec0b18506c8df10cdf4c8cca19d Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 21:49:36 +0300 Subject: [PATCH 05/18] Update pip package to include icons, exclude docs --- .gitignore | 1 + MANIFEST.in | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 59294ab3..9d33a849 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ __pycache__ .DS_Store .emacs.desktop* +*.py[cod] tests/data/models tests/data/embeddings src/.data diff --git a/MANIFEST.in b/MANIFEST.in index c907129d..0819781a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include Readme.md -graft docs* -global-exclude .DS_Store *.py[cod] +graft src/interface/web/assets/icons* +prune docs* +global-exclude .DS_Store *.py[cod] \ No newline at end of file From 34296031c48240148173124790a2366f9e2aa50b Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 21:50:20 +0300 Subject: [PATCH 06/18] Name test workflow. Check if exiftool is even required for pytests --- .github/workflows/test.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fe63c6e..f444fa78 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,8 +22,8 @@ on: jobs: test: + name: Run Tests runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 @@ -32,10 +32,6 @@ jobs: with: python-version: '3.10' - - name: Install System Dependencies - shell: bash -l {0} - run: sudo apt-get -y install libimage-exiftool-perl - - name: Install Python Dependencies run: | python -m pip install --upgrade pip From ee3eddb044f699df732949c01b268ca6050020eb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 21:57:27 +0300 Subject: [PATCH 07/18] Create Workflow to Publish Application to (test) PyPI --- .github/workflows/publish.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..42c746ba --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,40 @@ +name: publish + +on: + pull_request: + branches: + - 'master' + paths: + - setup.py + - .github/workflows/publish.yml + +jobs: + test: + name: Publish App to PyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Install Python Dependencies + run: | + python -m pip install --upgrade pip + pip install build, twine + pip install --upgrade . + + - name: Build Application + run: | + rm -rf dist + python -m build + + - name: Publish App to Test PyPI + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} + run: | + twine check dist/* + twine upload -r testpypi dist/* \ No newline at end of file From f55eaf0a532bdbf188dedd0e6afa4c04ff25cdbb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 22:01:18 +0300 Subject: [PATCH 08/18] Remove comma in command to pip install multiple packages --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42c746ba..e2a123cb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,7 @@ jobs: - name: Install Python Dependencies run: | python -m pip install --upgrade pip - pip install build, twine + pip install build twine pip install --upgrade . - name: Build Application From 7a353066ddf4a25093e71e0e408671f108efd72b Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 22:37:16 +0300 Subject: [PATCH 09/18] Improve name, stages in Github Workflows for Publish and Test --- .github/workflows/publish.yml | 11 +++++++---- .github/workflows/test.yml | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e2a123cb..932fcc8c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,21 +20,24 @@ jobs: with: python-version: '3.10' - - name: Install Python Dependencies + - name: Install Dependencies run: | python -m pip install --upgrade pip pip install build twine + + - name: Install Application + run: | pip install --upgrade . - - name: Build Application + - name: Build, Check App to Publish run: | rm -rf dist python -m build + twine check dist/* - - name: Publish App to Test PyPI + - name: Publish App to PyPI env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} run: | - twine check dist/* twine upload -r testpypi dist/* \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f444fa78..bea538c7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,12 +32,15 @@ jobs: with: python-version: '3.10' - - name: Install Python Dependencies + - name: Install Dependencies run: | python -m pip install --upgrade pip pip install pytest + + - name: Install Application + run: | pip install --upgrade . - - name: Test with pytest + - name: Test Application run: | pytest \ No newline at end of file From ee65809dc69e26688f681ab5abf64768ef31264a Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Wed, 3 Aug 2022 23:00:20 +0300 Subject: [PATCH 10/18] Update Dockerfile to use Pip instead of Conda to install application - Reduce size of app copied to container by adding unneeded directories to .dockerignore. E.g Ignore docs, tests, pip build, dist - Update MANIFEST.ini to include web, emacs interface directories Web directory is used by the web interface which will be exposed by the docker container --- .dockerignore | 6 ++++++ Dockerfile | 32 ++++++++++++-------------------- MANIFEST.in | 3 ++- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.dockerignore b/.dockerignore index 6e5dbf0d..2c5ea300 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,9 @@ .git/ .pytest_cache/ .vscode/ +.venv/ +docs/ +tests/ +build/ +dist/ +*.egg-info/ diff --git a/Dockerfile b/Dockerfile index baba33ec..3bb72ce8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,21 @@ # syntax=docker/dockerfile:1 -FROM continuumio/miniconda3:4.12.0 +FROM python:3.10-slim-bullseye -# Install system dependencies. +# Install System Dependencies RUN apt-get update -y && \ apt-get -y install libimage-exiftool-perl -# Add the local code to the /app directory and set it to be the working directory. -# Since we mount the /app directory as a volume in docker-compose.yml, this -# allows us to automatically update the code in the Docker image when it's changed. -ADD . /app +# Copy Application to Container +COPY . /app WORKDIR /app -# Get the arguments from the docker-compose environment. +# Install Python Dependencies +RUN pip install --upgrade pip && \ + pip install --upgrade . + +# Run the Application +# There are more arguments required for the application to run, +# but these should be passed in through the docker-compose.yml file. ARG PORT EXPOSE ${PORT} - -# Create the conda environment. -RUN conda env create -f config/environment.yml - -# Use the conda environment we created to run the application. -# To enable the conda env, we cannot simply RUN `conda activate khoj`, -# since each RUN command in a Dockerfile is a separate bash shell. -# The environment would not carry forward. -# Instead, we'll use `conda run` to run the application. -# There are more arguments required for the script to run, -# but these should be passed in through the docker-compose.yml file. -ENTRYPOINT ["conda", "run", "--no-capture-output", "--name", "khoj", \ - "python3", "-m", "src.main"] +ENTRYPOINT ["khoj"] diff --git a/MANIFEST.in b/MANIFEST.in index 0819781a..595ab4e1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,5 @@ include Readme.md -graft src/interface/web/assets/icons* +graft src/interface/* +prune src/interface/web/images* prune docs* global-exclude .DS_Store *.py[cod] \ No newline at end of file From 84adf0c56888f613a0534e199a039734ac4b0431 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 02:17:01 +0300 Subject: [PATCH 11/18] Use published docker image to run khoj service using docker-compose --- Dockerfile | 1 + docker-compose.yml | 10 +--------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3bb72ce8..d38a39af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # syntax=docker/dockerfile:1 FROM python:3.10-slim-bullseye +LABEL org.opencontainers.image.source https://github.com/debanjum/khoj # Install System Dependencies RUN apt-get update -y && \ diff --git a/docker-compose.yml b/docker-compose.yml index 82f86de3..01f0867c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,7 @@ version: "3.9" services: server: - build: - context: . - dockerfile: Dockerfile - args: - - PORT=8000 + image: ghcr.io/debanjum/khoj:latest ports: # If changing the local port (left hand side), no other changes required. # If changing the remote port (right hand side), @@ -29,9 +25,5 @@ services: # You can set these volumes to point to empty directories on host - ./tests/data/embeddings/:/data/embeddings/ - ./tests/data/models/:/data/models/ - deploy: - resources: - limits: - memory: 8g # Use 0.0.0.0 to explicitly set the host ip for the service on the container. https://pythonspeed.com/articles/docker-connection-refused/ command: --host="0.0.0.0" --port=8000 -c=config/khoj_sample.yml -vv From b2beff6a0e876bdf465d630751bc5c54040d572c Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 02:20:05 +0300 Subject: [PATCH 12/18] Only run build workflow on publish to master. Not on pull request --- .github/workflows/build.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fd777d5..ad56e8ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,6 @@ name: build on: - pull_request: - branches: - - master - paths: - - src/** - - config/** - - setup.py - - Dockerfile - - docker-compose.yml - - .github/workflows/build.yml push: branches: - master From b3ebb01beb42c153d1df48e15fc950eb11c570b6 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 02:20:45 +0300 Subject: [PATCH 13/18] Disable image search for now as unable to load CLIP model Loading CLIP Model from Sentence-Transformer is failing See https://github.com/UKPLab/sentence-transformers/issues/1659 for details --- config/khoj_sample.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/khoj_sample.yml b/config/khoj_sample.yml index 077c8564..b6098bcd 100644 --- a/config/khoj_sample.yml +++ b/config/khoj_sample.yml @@ -20,11 +20,11 @@ content-type: compressed-jsonl: /data/embeddings/transactions.jsonl.gz embeddings-file: /data/embeddings/transaction_embeddings.pt - image: - input-directories: ["/data/images/"] - embeddings-file: "/data/embeddings/image_embeddings.pt" - batch-size: 50 - use-xmp-metadata: true +# image: +# input-directories: ["/data/images/"] +# embeddings-file: "/data/embeddings/image_embeddings.pt" +# batch-size: 50 +# use-xmp-metadata: true music: input-files: ["/data/music/music.org"] From 4bc5ac2420acc130fe89f9c4ec16fd6bea023afb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 03:18:51 +0300 Subject: [PATCH 14/18] Add pre-release version to package and upload to TestPyPI Update version to form {current-version}-alpha.{unix-timestamp} in setup.py --- .github/workflows/publish.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 932fcc8c..69fbf35a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -36,8 +36,20 @@ jobs: twine check dist/* - name: Publish App to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} + run: | + twine upload dist/* + + - name: Publish App to Test PyPI env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} run: | + sed -E -i "s/version='(.*)',/version=\1-alpha.$(date +%s)',/g" setup.py + rm -rf dist + python -m build + twine check dist/* twine upload -r testpypi dist/* \ No newline at end of file From 89044c70bd67eafefc38a62ce039e660a5ca2425 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 03:49:32 +0300 Subject: [PATCH 15/18] Publish to Test PyPI on Push to PR or Master Branch --- .github/workflows/publish.yml | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 69fbf35a..e3cd4454 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,11 +5,19 @@ on: branches: - 'master' paths: + - src/** + - setup.py + - .github/workflows/publish.yml + push: + branches: + - 'master' + paths: + - src/** - setup.py - .github/workflows/publish.yml jobs: - test: + publish: name: Publish App to PyPI runs-on: ubuntu-latest steps: @@ -43,12 +51,26 @@ jobs: run: | twine upload dist/* - - name: Publish App to Test PyPI + - name: Publish PR to Test PyPI + if: github.event_name == 'pull_request' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} + PULL_REQUEST_NUMBER: ${{ github.event.number }} + run: | + sed -E -i "s/version=(.*)',/version=\1-alpha.$PULL_REQUEST_NUMBER.$(date +%s)',/g" setup.py + rm -rf dist + python -m build + twine check dist/* + twine upload -r testpypi dist/* + + - name: Publish Master to Test PyPI + if: github.ref == 'refs/heads/master' env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} run: | - sed -E -i "s/version='(.*)',/version=\1-alpha.$(date +%s)',/g" setup.py + sed -E -i "s/version=(.*)',/version=\1-beta.$(date +%s)',/g" setup.py rm -rf dist python -m build twine check dist/* From c3ae3cb021eb24a8eb10fca959d391241eb716eb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 04:15:16 +0300 Subject: [PATCH 16/18] Publish to (Test) PyPi with PEP440 Compliant Version Numbers - Use .devN for publish to testpypi on push to PR - Use aN to publish to pypi on push to master --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e3cd4454..24efef4e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -58,7 +58,7 @@ jobs: TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} PULL_REQUEST_NUMBER: ${{ github.event.number }} run: | - sed -E -i "s/version=(.*)',/version=\1-alpha.$PULL_REQUEST_NUMBER.$(date +%s)',/g" setup.py + sed -E -i "s/version=(.*)',/version=\1.dev$PULL_REQUEST_NUMBER$(date +%s)',/g" setup.py rm -rf dist python -m build twine check dist/* @@ -68,10 +68,10 @@ jobs: if: github.ref == 'refs/heads/master' env: TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_KEY }} + TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} run: | - sed -E -i "s/version=(.*)',/version=\1-beta.$(date +%s)',/g" setup.py + sed -E -i "s/version=(.*)',/version=\1a$(date +%s)',/g" setup.py rm -rf dist python -m build twine check dist/* - twine upload -r testpypi dist/* \ No newline at end of file + twine upload dist/* \ No newline at end of file From 50575b283c712468b0a778eaf5e0d1fc72a23d9d Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 04:40:35 +0300 Subject: [PATCH 17/18] Reorder publish actions by order of importance in publish workflow --- .github/workflows/publish.yml | 37 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 24efef4e..d9c50d91 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,18 +37,27 @@ jobs: run: | pip install --upgrade . - - name: Build, Check App to Publish - run: | - rm -rf dist - python -m build - twine check dist/* - - - name: Publish App to PyPI + - name: Publish Release to PyPI if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} run: | + rm -rf dist + python -m build + twine check dist/* + twine upload dist/* + + - name: Publish Master to PyPI + if: github.ref == 'refs/heads/master' + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} + run: | + sed -E -i "s/version=(.*)',/version=\1a$(date +%s)',/g" setup.py + rm -rf dist + python -m build + twine check dist/* twine upload dist/* - name: Publish PR to Test PyPI @@ -62,16 +71,4 @@ jobs: rm -rf dist python -m build twine check dist/* - twine upload -r testpypi dist/* - - - name: Publish Master to Test PyPI - if: github.ref == 'refs/heads/master' - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} - run: | - sed -E -i "s/version=(.*)',/version=\1a$(date +%s)',/g" setup.py - rm -rf dist - python -m build - twine check dist/* - twine upload dist/* \ No newline at end of file + twine upload -r testpypi dist/* \ No newline at end of file From ebaf5524d192722d2acf6b31e43e904583266e1e Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Thu, 4 Aug 2022 04:45:20 +0300 Subject: [PATCH 18/18] Bump khoj patch version in setup.py - PRs and Pushes to Master show up as newer than previous release. But they're marked as development release or pre-release (alpha) - Once create tag. The published pip package than becomes a final release in PEP440 terminology --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b3787d4c..eca9ce4d 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ this_directory = Path(__file__).parent setup( name='khoj-assistant', - version='0.1.4', + version='0.1.5', description="A natural language search engine for your personal notes, transactions and images", long_description=(this_directory / "Readme.md").read_text(encoding="utf-8"), long_description_content_type="text/markdown",