Skip to content

Commit

Permalink
Merge branch 'main' into ci/update-names
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue authored Jul 21, 2023
2 parents 982b55f + ea95e93 commit e4d6602
Show file tree
Hide file tree
Showing 16 changed files with 56 additions and 63 deletions.
22 changes: 9 additions & 13 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ env:
DOCUMENTATION_CNAME: 'pymeilisearch.docs.ansys.com'
LIBRARY_NAME: 'pymeilisearch'
LIBRARY_NAMESPACE: 'ansys.tools.meilisearch'
PACKAGE_NAME: 'pymeilisearch'
MEILISEARCH_API_PUBLIC_KEY: ${{ secrets.MEILISEARCH_API_PUBLIC_KEY }}
MEILISEARCH_HOST_URL: https://backend.search.pyansys.com
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
Expand Down Expand Up @@ -47,8 +46,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
should-release:
python-version: ['3.8', '3.9', '3.10', '3.11']
should-release:
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
exclude:
- should-release: false
Expand All @@ -57,8 +56,8 @@ jobs:
- name: "Build wheelhouse and perform smoke test"
uses: ansys/actions/build-wheelhouse@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
library-name: ${{ env.LIBRARY_NAME }}
library-namespace: ${{ env.LIBRARY_NAMESPACE }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

Expand All @@ -75,20 +74,17 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Test the meilisearch container
working-directory: docker
run: docker-compose up -d

- name: Checkout code
uses: actions/checkout@v3

- name: Install the project with testing dependencies
run: pip install .[tests]

- name: Run tests
run: pytest tests -vv

- name: Stop services
if: always()
working-directory: docker
Expand Down Expand Up @@ -123,21 +119,21 @@ jobs:
- name: "Release to the private PyPI repository"
uses: ansys/actions/release-pypi-private@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-name: ${{ env.LIBRARY_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}

- name: "Release to the public PyPI repository"
uses: ansys/actions/release-pypi-public@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-name: ${{ env.LIBRARY_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYPI_TOKEN }}

- name: "Release to GitHub"
uses: ansys/actions/release-github@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-name: ${{ env.LIBRARY_NAME }}

doc-deploy-dev:
name: "Deploy development docs"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
# Label based on branch name
- uses: actions-ecosystem/action-add-labels@v1
if: |
startsWith(github.event.pull_request.head.ref, 'doc') ||
startsWith(github.event.pull_request.head.ref, 'doc') ||
startsWith(github.event.pull_request.head.ref, 'docs')
with:
labels: documentation
Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
repos:

- repo: https://github.com/psf/black
rev: 23.3.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
rev: 23.7.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
hooks:
- id: black

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.14.0
rev: 1.15.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.0]
additional_dependencies: [black==23.7.0]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
Expand Down Expand Up @@ -40,15 +40,17 @@ repos:
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
- id: trailing-whitespace

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.2
rev: 0.23.3
hooks:
- id: check-github-workflows

- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.0-alpha.9-for-vscode'
rev: 'v3.0.0'
hooks:
- id: prettier
types_or: [css, javascript, html]
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Contributing
# Contributing

If you are interested in contributing to our project, please make sure to review
our contribution guidelines, which are specified in the
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
## Contributors

* [Jorge Martinez](https://github.com/jorgepiloto)
* [Roberto Pastor Muela](https://github.com/RobPasMue)
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ pymeilisearch

**An enhanced Python API to Meilisearch**

|python| |pypi| |GH-CI| |codecov| |MIT| |black|
|ansys| |python| |pypi| |GH-CI| |MIT| |black|

.. |ansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?labelColor=black&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
:target: https://actions.docs.ansys.com/
:alt: PyAnsys

.. |python| image:: https://img.shields.io/pypi/pyversions/pymeilisearch?logo=pypi
:target: https://pypi.org/project/pymeilisearch/
Expand All @@ -13,10 +17,6 @@ pymeilisearch
:target: https://pypi.org/project/pymeilisearch
:alt: PyPI

.. |codecov| image:: https://codecov.io/gh/ansys/pymeilisearch/branch/main/graph/badge.svg
:target: https://codecov.io/gh/pyansys/pymeilisearch
:alt: Codecov

.. |GH-CI| image:: https://github.com/ansys/pymeilisearch/actions/workflows/ci_cd.yml/badge.svg
:target: https://github.com/ansys/pymeilisearch/actions/workflows/ci_cd.yml
:alt: GH-CI
Expand Down Expand Up @@ -122,6 +122,6 @@ resources and troubleshooting guides.
License
=======

You can find the full text of the license in the `LICENSE` file.
You can find the full text of the license in the `LICENSE`_ file.

.. _license: https://github.com/ansys/pymeilisearch/blob/main/LICENSE
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# customized clean due to api examples
clean:
rm -rf $(BUILDDIR)
Expand Down
2 changes: 1 addition & 1 deletion doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ goto end
cd "%BUILDDIR%\latex"
for %%f in (*.tex) do (
pdflatex "%%f" --interaction=nonstopmode)

:end
popd
13 changes: 1 addition & 12 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import datetime
import os

from ansys_sphinx_theme import get_version_match, pyansys_logo_black
from ansys_sphinx_theme import get_version_match

from ansys.tools.meilisearch import __version__

Expand All @@ -15,16 +15,12 @@
"""The canonical name of the webpage hosting the documentation."""

# Select desired logo, theme, and declare the html title
html_logo = pyansys_logo_black
html_theme = "ansys_sphinx_theme"
html_short_title = html_title = project
html_theme_options = {
"github_url": "https://github.com/ansys/pymeilisearch",
"show_prev_next": False,
"show_breadcrumbs": True,
"additional_breadcrumbs": [
("PyAnsys", "https://docs.pyansys.com/"),
],
"switcher": {
"json_url": f"https://{cname}/versions.json",
"version_match": get_version_match(__version__),
Expand Down Expand Up @@ -52,13 +48,6 @@
# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
# kept here as an example
# "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
# "numpy": ("https://numpy.org/devdocs", None),
# "matplotlib": ("https://matplotlib.org/stable", None),
# "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
# "pyvista": ("https://docs.pyvista.org/", None),
# "grpc": ("https://grpc.github.io/grpc/python/", None),
}

# numpydoc configuration
Expand Down
5 changes: 4 additions & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Overall guidance on contributing to a PyAnsys library appears in the
in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
with it and all `Coding style <dev_guide_coding_style_>`_ before attempting to
contribute to pymeilisearch.

The following contribution information is specific to pymeilisearch.


Expand Down Expand Up @@ -71,12 +71,15 @@ This way, it's not possible for you to push code that fails the style checks. Fo

$ pre-commit install
$ git commit -am "FEAT: added the new feature"
black....................................................................Passed
blacken-docs.............................................................Passed
isort....................................................................Passed
flake8...................................................................Passed
codespell................................................................Passed
check for merge conflicts................................................Passed
debug statements (python)................................................Passed
check yaml...............................................................Passed
trim trailing whitespace.................................................Passed
Validate GitHub Workflows................................................Passed
prettier.................................................................Passed

Expand Down
18 changes: 9 additions & 9 deletions doc/source/getting-started/installing-pymeilisearch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@ There are multiple sources for installing the latest stable version of
.. tab-set::

.. tab-item:: Public PyPI

.. code-block:: console
python -m pip install pymeilisearch
.. tab-item:: Private PyPI

.. code-block:: console
export TWINE_USERNAME="__token__"
export TWINE_REPOSITORY_URL="https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload"
export TWINE_PASSWORD=***
python -m pip install pymeilisearch
.. tab-item:: GitHub

.. code-block:: console
python -m pip install git+https://github.com/ansys/pymeilisearch.git@v{{ version }}
Expand Down Expand Up @@ -84,7 +84,7 @@ Move inside the project and create a new Python environment:
.. tab-item:: Linux/UNIX

.. code-block:: text
python -m venv <venv>
Activate previous environment:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting-started/meilisearch-images.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Once installed, run a local instance of meilisearch by running:

- uuidgen
- openssl rand
- shasum
- shasum


For more advanced topics on how to use meilisearch, visit the `meilisearch
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user-guide/cli-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Syntax:
Required arguments:

- ``--template <template name or path>`` indicates the Name of the template to use or specify the path where the template is located.
- ``--template <template name or path>`` indicates the Name of the template to use or specify the path where the template is located.
Available templates are `sphinx_pydata` and `default`. The `config file` required to know which content you want to scrape.
The example `config files` available in `meilisearch-docs-scrapper`_.

Expand Down
8 changes: 4 additions & 4 deletions doc/source/user-guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ guide includes the steps of using the CLI tool effectively.
:link: cli-usage
:link-type: doc

Learn how to use PyMeilisearch from the command line. Covers the installation
process and examples of common commands and their usage.
Learn how to use PyMeilisearch from the command line. Covers the installation
process and examples of common commands and their usage.

.. grid-item-card:: Web component :fas:`fa fa-server`
:link: web-component
:link-type: doc

Integrate Meilisearch in a website by creating a search bar
component and linking it to a running meilisearch instance.

.. toctree::
:hidden:
:maxdepth: 3
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name = "pymeilisearch"
version = "0.2.dev0"
description = " A Python library for effortless indexing and searching of documentation using MeiliSearch."
readme = "README.rst"
requires-python = ">=3.7"
requires-python = ">=3.8,<4"
license = {file = "LICENSE"}
authors = [
{name = "ANSYS, Inc.", email = "[email protected]"},
Expand Down Expand Up @@ -39,11 +39,11 @@ tests = [
doc = [
"ansys-sphinx-theme==0.9.9",
"numpydoc==1.5.0",
"Sphinx==6.2.1",
"Sphinx==6.2.1",
"sphinx-design==0.4.1",
"sphinx-jinja==2.0.2",
"sphinx-autoapi==2.1.1",
"meilisearch==0.28.0",
"meilisearch==0.28.0",
"sphinx-copybutton==0.5.2",
"sphinx-notfound-page==0.8.3",
"sphinx-jinja==2.0.2",
Expand All @@ -58,6 +58,8 @@ pymeilisearch = "ansys.tools.meilisearch.cli:main"
[project.urls]
Source = "https://github.com/ansys/pymeilisearch"
Tracker = "https://github.com/ansys/pymeilisearch/issues"
Discussions = "https://github.com/ansys/pymeilisearch/discussions"
Releases = "https://github.com/ansys/pymeilisearch/releases"
Homepage = "https://github.com/ansys/pymeilisearch"
Documentation = "https://pymeilisearch.docs.ansys.com"

Expand All @@ -72,7 +74,7 @@ default_section = "THIRDPARTY"
src_paths = ["doc", "src", "tests"]

[tool.coverage.run]
source = ["ansys.tools"]
source = ["ansys.tools.meilisearch"]

[tool.coverage.report]
show_missing = true
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ isolated_build_env = build
[testenv]
description = Checks for project unit tests and coverage (if desired)
basepython =
tests37: python3.7
tests38: python3.8
tests39: python3.9
tests310: python3.10
tests311: python3.11
{style,tests,doc}: python3
extras =
tests
passenv = *
passenv = *
setenv =
PYTHONUNBUFFERED = yes
cov: PYTEST_EXTRA_ARGS = --cov=ansys.tools --cov-report=term --cov-report=xml:.cov/xml --cov-report=html:.cov/html
Expand All @@ -34,7 +34,7 @@ commands =

[testenv:doc]
description = Check if documentation generates properly
passenv = *
passenv = *
extras =
doc
commands =
Expand Down

0 comments on commit e4d6602

Please sign in to comment.