Skip to content

Commit

Permalink
Merge branch 'main' into max_tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
masci committed May 17, 2023
2 parents e5c15a9 + 9d52998 commit d82aaa6
Show file tree
Hide file tree
Showing 137 changed files with 7,246 additions and 2,202 deletions.
47 changes: 47 additions & 0 deletions .github/utils/pyproject_to_requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import argparse
import re
import sys
from pathlib import Path

import toml

matcher = re.compile(r"farm-haystack\[(.+)\]")
parser = argparse.ArgumentParser(
prog="pyproject_to_requirements.py", description="Convert pyproject.toml to requirements.txt"
)
parser.add_argument("pyproject_path")
parser.add_argument("--extra", default="")


def resolve(target: str, extras: dict, results: set):
if target not in extras:
results.add(target)
return

for t in extras[target]:
m = matcher.match(t)
if m:
for i in m.group(1).split(","):
resolve(i, extras, results)
else:
resolve(t, extras, results)


def main(pyproject_path: Path, extra: str = ""):
content = toml.load(pyproject_path)
# basic set of dependencies
deps = set(content["project"]["dependencies"])

if extra:
extras = content["project"]["optional-dependencies"]
resolve(extra, extras, deps)

sys.stdout.write("\n".join(sorted(deps)))
sys.stdout.write("\n")


if __name__ == "__main__":
args = parser.parse_args()
pyproject_path = Path(args.pyproject_path).absolute()

main(pyproject_path, args.extra)
6 changes: 3 additions & 3 deletions .github/utils/release_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_versions():
url = "https://dash.readme.com/api/v1/version"
res = requests.get(url, auth=ReadmeAuth(), timeout=30)
res.raise_for_status()
return [v["version_clean"] for v in res.json()]
return [v["version"] for v in res.json()]


def create_new_unstable(current, new):
Expand Down Expand Up @@ -63,7 +63,7 @@ def promote_unstable_to_stable(unstable, stable):
def calculate_new_unstable(version):
# version must be formatted like so <major>.<minor>
major, minor = version.split(".")
return f"{major}.{int(minor) + 1}.0-unstable"
return f"{major}.{int(minor) + 1}-unstable"


if __name__ == "__main__":
Expand All @@ -77,7 +77,7 @@ def calculate_new_unstable(version):
sys.exit("Version must be formatted like so <major>.<minor>")

# This two are the version that we must have published in the end
new_stable = f"{args.new_version}.0"
new_stable = f"{args.new_version}"
new_unstable = calculate_new_unstable(args.new_version)

versions = get_versions()
Expand Down
191 changes: 0 additions & 191 deletions .github/workflows/compliance.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/examples-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Haystack
run: pip install .[all]
run: pip install .[all,dev]

- name: Run
run: pytest examples/
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/imports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ env:
jobs:

base-install:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:

- uses: actions/checkout@v3
Expand All @@ -37,5 +44,5 @@ jobs:
- name: Install Haystack with no extras
run: pip install .

- name: Try to import
- name: Import Haystack
run: python -c 'import haystack'
Loading

0 comments on commit d82aaa6

Please sign in to comment.