Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix readthedocs build #1105

Merged
merged 17 commits into from
May 16, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11"]
exclude:
- os: windows-latest
python-version: 3.8
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ formats:
- htmlzip
- pdf
conda:
environment: docs/environment-docs.yml
environment: docs/docs-env.yml
build:
os: ubuntu-20.04
tools:
python: "mambaforge-4.10"
sphinx:
builder: html
configuration: docs/conf.py
fail_on_warning: True
fail_on_warning: false
9 changes: 5 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"gsd.fl",
"freud",
"freud.box",
"treelib",
]
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()
Expand Down Expand Up @@ -133,10 +134,10 @@
_python_doc_base = "https://docs.python.org/3.9"

intersphinx_mapping = {
_python_doc_base: None,
"https://numpy.org/doc/stable": None,
"https://docs.scipy.org/doc/scipy/reference": None,
"https://scikit-learn.org/stable": None,
"python": ("https://docs.python.org/3.9", None),
"numpy": ("https://numpy.org/doc/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"scikit-learn": ("https://scikit-learn.org/stable", None),
}

# Add any paths that contain templates here, relative to this directory.
Expand Down
21 changes: 21 additions & 0 deletions docs/docs-env.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: mbuild-docs
channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
dependencies:
- python>=3.8
- pip
- pip:
- boltons
- networkx
- sphinx
- sphinx_rtd_theme
- sphinxcontrib-svg2pdfconverter[CairoSVG]
- cairosvg
- nbsphinx
- networkx >=2.0
- lark-parser
- requests
- lxml
- numpydoc
- widgetsnbextension
21 changes: 0 additions & 21 deletions docs/environment-docs.yml

This file was deleted.

9 changes: 0 additions & 9 deletions docs/requirements.txt

This file was deleted.

6 changes: 4 additions & 2 deletions mbuild/recipes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class Recipes(object):


recipes = Recipes()
from pkg_resources import iter_entry_points
from importlib import metadata

entry_points = metadata.entry_points()["mbuild.plugins"]

available_methods = []
for entry_point in iter_entry_points(group="mbuild.plugins", name=None):
for entry_point in entry_points:
setattr(recipes, entry_point.name, entry_point.load())
8 changes: 4 additions & 4 deletions mbuild/utils/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
##############################################################################
"""
import importlib
import importlib.resources as resources
import inspect
import os
import sys
import textwrap
import warnings
from unittest import SkipTest

from pkg_resources import resource_filename


class DelayImportError(ImportError, SkipTest):
"""Error to allow better import handling."""
Expand Down Expand Up @@ -396,10 +395,11 @@ def get_fn(name):
name : str
Name of the file to load (with respect to the reference/ folder).
"""
fn = resource_filename("mbuild", os.path.join("utils", "reference", name))
fn = resources.files("mbuild").joinpath("utils", "reference", name)
# fn = resource_filename("mbuild", os.path.join("utils", "reference", name))
if not os.path.exists(fn):
raise IOError("Sorry! {} does not exists.".format(fn))
return fn
return str(fn)


def run_from_ipython():
Expand Down