-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into playwright_integration
- Loading branch information
Showing
195 changed files
with
6,945 additions
and
3,913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,9 +51,13 @@ jobs: | |
id: semantic | ||
with: | ||
working_directory: ./helm-chart | ||
semantic_version: 18.0.1 | ||
extra_plugins: | | ||
[email protected] | ||
@semantic-release/[email protected] | ||
[email protected] | ||
@semantic-release/[email protected] | ||
extends: | | ||
semantic-release-monorepo | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.7-slim | ||
|
||
# Set the working directory to /app | ||
WORKDIR /app | ||
|
||
# Copy the current directory contents into the container at /app | ||
COPY . /app | ||
|
||
# Install psycopg2 dependencies | ||
RUN apt-get update && apt-get install -y libpq-dev | ||
|
||
# Install gcc | ||
RUN apt-get update && apt-get install -y gcc | ||
|
||
# Install any needed packages specified in requirements.txt | ||
RUN pip install --trusted-host pypi.python.org -r requirements.txt | ||
|
||
# Make port 8000 available to the world outside this container | ||
EXPOSE 8000 | ||
|
||
# Define environment variable | ||
ENV NAME Sefaria-Project | ||
|
||
# Run app.py when the container launches | ||
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import django | ||
django.setup() | ||
from sefaria.model import * | ||
from typing import List | ||
from enum import Enum | ||
|
||
class APIWarningCode(Enum): | ||
APINoVersion = 101 | ||
APINoLanguageVersion = 102 | ||
APINoSourceText = 103 | ||
APINoTranslationText = 104 | ||
|
||
""" | ||
classes for data warnings in API calls. | ||
used when part of the data that was requested exists and returned, and part is missing. | ||
""" | ||
|
||
class APIDatawarning(): | ||
""" | ||
general class | ||
""" | ||
|
||
def __init__(self): | ||
pass | ||
|
||
|
||
class TextsAPIResponseMessage(APIDatawarning): | ||
""" | ||
class for returning a message and an warning code | ||
""" | ||
|
||
def get_message(self) -> dict: | ||
return {'warning_code': self.warning_code.value, | ||
'message': self.message} | ||
|
||
|
||
class APINoVersion(TextsAPIResponseMessage): | ||
|
||
def __init__(self, oref: Ref, vtitle: str, lang: str): | ||
self.warning_code = APIWarningCode.APINoVersion | ||
self.message = f'We do not have version named {vtitle} with language {lang} for {oref}' | ||
|
||
|
||
class APINoLanguageVersion(TextsAPIResponseMessage): | ||
|
||
def __init__(self, oref: Ref, langs: List[str]): | ||
self.warning_code = APIWarningCode.APINoLanguageVersion | ||
self.message = f'We do not have the language you asked for {oref}. Available languages are {langs}' | ||
|
||
|
||
class APINoSourceText(TextsAPIResponseMessage): | ||
|
||
def __init__(self, oref: Ref): | ||
self.warning_code = APIWarningCode.APINoSourceText | ||
self.message = f'We do not have the source text for {oref}' | ||
|
||
|
||
class APINoTranslationText(TextsAPIResponseMessage): | ||
|
||
def __init__(self, oref: Ref): | ||
self.warning_code = APIWarningCode.APINoTranslationText | ||
self.message = f'We do not have a translation for {oref}' |
Oops, something went wrong.