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

Remove deprecation warning #131

Merged
merged 10 commits into from
Jan 19, 2024
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## 0.7 (Not Releases)
## 0.7.0

### Prs in Release

- [Fix section case](https://github.com/jdoiro3/mkdocs-multirepo-plugin/pull/124)
- [Remove deprecation warning](https://github.com/jdoiro3/mkdocs-multirepo-plugin/pull/131)

## 0.6.3

Expand Down
11 changes: 1 addition & 10 deletions mkdocs_multirepo_plugin/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from typing import Callable, Dict, List, Optional, Tuple, Union

from mkdocs.config import Config
from mkdocs.structure.files import File, Files, _filter_paths, _sort_files
from mkdocs.structure.files import File, Files, _sort_files
from mkdocs.utils import yaml_load
from slugify import slugify

Expand Down Expand Up @@ -433,25 +433,16 @@ async def batch_import(
def get_files(config: Config, repo: DocsRepo) -> Files:
"""Walk the `docs_dir` and return a Files collection."""
files = []
exclude = [".*", "/templates"]

for source_dir, dirnames, filenames in os.walk(repo.location, followlinks=True):
relative_dir = os.path.relpath(source_dir, repo.temp_dir)

for dirname in list(dirnames):
path = os.path.normpath(os.path.join(relative_dir, dirname))
# Skip any excluded directories
if _filter_paths(basename=dirname, path=path, is_dir=True, exclude=exclude):
dirnames.remove(dirname)
dirnames.sort()

for filename in _sort_files(filenames):
path = os.path.normpath(os.path.join(relative_dir, filename))
# Skip any excluded files
if _filter_paths(
basename=filename, path=path, is_dir=False, exclude=exclude
):
continue
# Skip README.md if an index file also exists in dir
if filename == "README.md" and "index.md" in filenames:
log.warning(
Expand Down
4 changes: 1 addition & 3 deletions mkdocs_multirepo_plugin/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
from sys import platform, version_info
from typing import Any, Dict

from mkdocs.utils import warning_filter

# used for getting Git version
GitVersion = namedtuple("GitVersion", "major minor")
LINUX_LIKE_PLATFORMS = ["linux", "linux2", "darwin"]

# This is a global variable imported by other modules
log = logging.getLogger("mkdocs.plugins." + __name__)
log.addFilter(warning_filter)
jdoiro3 marked this conversation as resolved.
Show resolved Hide resolved


class ImportDocsException(Exception):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mkdocs-multirepo-plugin"
version = "0.6.3"
version = "0.7.0"
description = "Build documentation in multiple repos into one site."
authors = ["jdoiro3 <[email protected]>"]
license = "MIT"
Expand Down
Loading