Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Release v1 #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions 34 .github/workflows/codecov.yml

This file was deleted.

72 changes: 44 additions & 28 deletions 72 .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,64 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- uses: actions/cache@v2
id: cache-venv
with:
path: |
~/.cache/pip
~/.cache/pre-commit
key: ${{ runner.os }}-pip-2
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- run: python -m pip install pre-commit
- run: pre-commit run --all-files
get-python-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: set-matrix
run: echo "::set-output name=matrix::$(python .github/scripts/get_python_versions.py)"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
path: .venv
key: venv-0
- run: |
python -m venv .venv --upgrade-deps
source .venv/bin/activate
pip install pre-commit
if: steps.cache-venv.outputs.cache-hit != 'true'
- uses: actions/cache@v2
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: key-0
- run: |
source .venv/bin/activate
pre-commit run --all-files

test:
needs: [ linting, get-python-versions ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.matrix) }}
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1.1.6
python-version: "${{ matrix.python-version }}"
- uses: actions/cache@v2
id: poetry-cache
with:
path: ~/.local
key: key-0
- uses: snok/install-poetry@v1
with:
version: 1.2.0a1
virtualenvs-in-project: true
virtualenvs-create: false
version: 1.2.0a2
- uses: actions/cache@v2
id: cache-venv
with:
path: .venv
key: ${{ hashFiles('**/poetry.lock') }}-3
- run: poetry install --no-interaction --no-root
key: ${{ hashFiles('**/poetry.lock') }}-0
- run: |
python -m venv .venv
source .venv/bin/activate
pip install -U pip
poetry install --no-interaction --no-root
if: steps.cache-venv.outputs.cache-hit != 'true'
- run: poetry install --no-interaction
- run: poetry run pytest -m "not unsupported"
- name: Run tests
run: |
source .venv/bin/activate
pytest -m "not unsupported" --cov-report=xml
coverage report
- uses: codecov/codecov-action@v2
with:
file: ./coverage.xml
fail_ci_if_error: true
if: matrix.python-version == '3.10'
11 changes: 6 additions & 5 deletions 11 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/ambv/black
rev: 21.5b2
rev: 21.10b0
hooks:
- id: black
args: [ "--quiet" ]
Expand Down Expand Up @@ -35,16 +35,17 @@ repos:
'flake8-type-checking',
]
- repo: https://github.com/asottile/pyupgrade
rev: v2.19.1
rev: v2.29.0
hooks:
- id: pyupgrade
args: [ "--py36-plus", "--py37-plus",'--keep-runtime-typing' ]
- repo: https://github.com/pycqa/isort
rev: 5.8.0
rev: 5.10.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
rev: v0.910-1
hooks:
- id: mypy
additional_dependencies: [ pytest ]
additional_dependencies:
- types-requests
Empty file removed 0 CHANGELOG.md
Empty file.
7 changes: 3 additions & 4 deletions 7 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

# Sanity HTML Renderer for Python

> Repo is currently a work in progress. Not production ready.

This package generates HTML from [Portable Text](https://github.com/portabletext/portabletext).

For the most part, it mirrors [Sanity's](https://www.sanity.io/) own [block-content-to-html](https://www.npmjs.com/package/%40sanity/block-content-to-html) NPM library.
Expand Down Expand Up @@ -214,8 +212,9 @@ Blocks can optionally define a `style` tag. These styles are supported:

## Missing features

We plan to implement a default built-in serializer for the `image` type.
In the meantime, you should be able to serialize image types by passing a custom serializer.
For anyone interested, we would be happy to see a
default built-in serializer for the `image` type added.
In the meantime, users should be able to serialize image types by passing a custom serializer.

## Contributing

Expand Down
54 changes: 28 additions & 26 deletions 54 poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions 9 pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
[tool.poetry]
name = 'sanity-html'
version = '0.0.7'
version = '1.0.0'
description = "HTML renderer for Sanity's Portable Text format"
homepage = 'https://github.com/otovo/python-sanity-html'
repository = 'https://github.com/otovo/python-sanity-html'
authors = ['Kristian Klette <klette@otovo.com>']
maintainers = ['Sondre Lilleb酶 Gundersen <sondrelg@live.no>']
license = 'Apache2'
readme = 'README.md'
keywords = ['Sanity', 'Portable text', 'HTML', 'Parsing']
keywords = ['sanity', 'portable', 'text', 'html', 'parsing']
include = ['CHANGELOG.md']
packages = [{ include = 'sanity_html' }]
classifiers = [
'Development Status :: 3 - Alpha',
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Environment :: Web Environment',
'Operating System :: OS Independent',
Expand All @@ -26,9 +26,6 @@ classifiers = [
'Typing :: Typed',
]

[tool.poetry.urls]
'Changelog' = 'https://github.com/otovo/python-sanity-html/blob/main/CHANGELOG.md'

[tool.poetry.dependencies]
python = '^3.7'

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.