Skip to content

Commit

Permalink
Fixed dependency on deprecated distutils package + Updated project to…
Browse files Browse the repository at this point in the history
… use pyproject.toml instead of setup.py
  • Loading branch information
ovasquez committed Jul 31, 2024
1 parent 6ce737b commit 8f89d74
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 91 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Oscar Vasquez
Copyright (c) 2024 Oscar Vasquez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ nav:
### Dev Install

Clone the repository and specify the `dev` dependencies on the install command.

Check this [StackOverflow answer](https://stackoverflow.com/a/28842733/2313246) for more details about the `dev`
dependencies
Project has been updated to use `pyproject.toml` so the version has to be manually synchronized in both `__init__.py` and `pyproject.toml`.

```bash
$ pip install -e .[dev]
# Using quotes for zsh compatibility
$ pip install -e '.[dev]'
```

### Test
Expand All @@ -88,6 +87,10 @@ The tests can be run using `tox` from the root directory. `tox` is part of the d
$ tox
```

### Publishing

The publishing process was updated to use GitHub Actions.

## Project Status

Very basic implementation. The code works but doesn't allow to specify options for the merging.
Expand Down
11 changes: 7 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ nav:
### Dev Install

Clone the repository and specify the `dev` dependencies on the install command.

Check this [StackOverflow answer](https://stackoverflow.com/a/28842733/2313246) for more details about the `dev`
dependencies
Project has been updated to use `pyproject.toml` so the version has to be manually synchronized.

```bash
$ pip install -e .[dev]
# Using quotes for zsh compatibility
$ pip install -e '.[dev]'
```

### Test
Expand All @@ -85,6 +84,10 @@ The tests can be run using `tox` from the root directory. `tox` is part of the d
$ tox
```

### Publishing

The publishing process was updated to use GitHub Actions.

## Project Status

Very basic implementation. The code works but doesn't allow to specify options for the merging.
Expand Down
2 changes: 1 addition & 1 deletion mkdocsmerge/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"""Init module of MkDocs Merge"""


__version__ = '0.8.0'
__version__ = '0.9.0'
7 changes: 3 additions & 4 deletions mkdocsmerge/merge.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os.path
from ruamel.yaml import YAML
# Both imports are needed to avoid errors in Windows
import distutils
from distutils import dir_util
# Using the setuptools version because of the deprecation of the distutils package
import setuptools._distutils.dir_util as dir_util

MKDOCS_YML = 'mkdocs.yml'
CONFIG_NAVIGATION = 'nav'
Expand Down Expand Up @@ -52,7 +51,7 @@ def merge_sites(sites, master_docs_root, unify_sites, print_func):

# NOTE: need to do this otherwise subsequent distutil.copy_tree will fail if
# mkdocs-merge is used as a module (https://stackoverflow.com/a/28055993/920464)
distutils.dir_util._path_created = {}
dir_util._path_created.clear()

new_navs = []
for site in sites:
Expand Down
46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mkdocs-merge"
version = "0.9.0"
description = "Tool to merge multiple MkDocs sites into a single directory"
readme = "README.md"
license = { text = "MIT" }
authors = [
{ name = "Oscar Vasquez", email = "oscar@vasquezcr.com" }
]
keywords = ["mkdocs", "documentation", "merge", "multiple"]
classifiers = [
"Development Status :: 4 - Beta",
"Topic :: Documentation",
"Topic :: Text Processing",
"Environment :: Console",
"Environment :: Web Environment",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
]
dependencies = [
"click>=5.0",
"mkdocs>=1.0",
"ruamel.yaml>=0.17"
]

[project.urls]
homepage = "https://github.com/ovasquez/mkdocs-merge"
repository = "https://github.com/ovasquez/mkdocs-merge"
download = "https://github.com/ovasquez/mkdocs-merge/archive/main.zip"

[project.optional-dependencies]
dev = [
"tox>=3.0",
"pytest",
"pytest-cov"
]

[project.scripts]
mkdocs-merge = "mkdocsmerge.__main__:cli"
77 changes: 0 additions & 77 deletions setup.py

This file was deleted.

0 comments on commit 8f89d74

Please sign in to comment.