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

Doc: typo & tips #179

Merged
merged 3 commits into from
Mar 23, 2023
Merged

Doc: typo & tips #179

merged 3 commits into from
Mar 23, 2023

Conversation

YDX-2147483647
Copy link
Contributor

@YDX-2147483647 YDX-2147483647 commented Mar 10, 2023

  • Fix typo.

  • Update the .vscode/settings.json example in CONTRIBUTING.md.

    Venv uses bin on POSIX, but Scripts on Windows.

  • Some tests won't pass without requirements/documentation.txt.

    See also: 4b1cfd adds documentation.txt into GitHub Actions.

    For example, test_simple_build in tests/test_build.py builds mkdocs.yml,
    and its theme (mkdocs-bootswatch/united) is not covered in
    requirements/development.txt.

    theme:
      name: united

- Fix typo.

- Update the `.vscode/settings.json` example in `CONTRIBUTING.md`.

  [Venv][venv-doc] uses `bin` on POSIX, but `Scripts` on Windows.

- Some tests won't pass without `requirements/documentation.txt`.

  For example, `test_simple_build` in `tests/test_build.py` builds `mkdocs.yml`,
  and its theme (mkdocs-bootswatch/united) is not covered in
  `requirements/development.txt`.

  ```yaml
  theme:
    name: united
  ```

[venv-doc]: https://docs.python.org/3.11/library/venv.html#how-venvs-work
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Mar 10, 2023
@Guts
Copy link
Owner

Guts commented Mar 11, 2023

Thank for this PR cleaning up the dust!

Some tests won't pass without requirements/documentation.txt.

Oh damn! It's not the expected at all! feel free to fix that by switching to a default theme.

@codecov
Copy link

codecov bot commented Mar 11, 2023

Codecov Report

Merging #179 (9b81eb1) into main (592956a) will decrease coverage by 0.06%.
The diff coverage is n/a.

❗ Current head 9b81eb1 differs from pull request most recent head e38ab72. Consider uploading reports for the commit e38ab72 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #179      +/-   ##
==========================================
- Coverage   79.79%   79.74%   -0.06%     
==========================================
  Files           7        7              
  Lines         396      395       -1     
  Branches       91       91              
==========================================
- Hits          316      315       -1     
  Misses         52       52              
  Partials       28       28              

see 1 file with indirect coverage changes

@YDX-2147483647
Copy link
Contributor Author

feel free to fix that by switching to a default theme.

Uhh, it might be difficult… The following test uses mkdocs.yml in project root (outside tests/fixtures/), which is the theme for our docs.

def test_simple_build(self):
with tempfile.TemporaryDirectory() as tmpdirname:
cli_result = self.build_docs_setup(
testproject_path="docs",
mkdocs_yml_filepath=Path("mkdocs.yml"),
output_path=tmpdirname,
strict=False,
)
if cli_result.exception is not None:
e = cli_result.exception
logger.debug(format_exception(type(e), e, e.__traceback__))
self.assertEqual(cli_result.exit_code, 0)
self.assertIsNone(cli_result.exception)

theme:
name: united

We can apply the .env + !ENV [MKDOCS_THEME, 'mkdocs'] trick, but is it really worth?

What do you think?

@YDX-2147483647
Copy link
Contributor Author

Hi, shall I replace test_simple_build with a new mkdocs.yml, or modify mkdocs.yml in the project root? Which do you prefer?

@Guts
Copy link
Owner

Guts commented Mar 22, 2023

Sorry for the delayed answer.

Hi, shall I replace test_simple_build with a new mkdocs.yml, or modify mkdocs.yml in the project root? Which do you prefer?

Replace test_simple_build with a new mkdocs.yml

`/mkdocs.yml` requires theme and plugins in
`requirements/documentation.txt`,
and `test_simple_build` will fail if they're not installed.

The commit removes those dependencies and
turns it into `tests/fixtures/mkdocs_simple.yml`.
@YDX-2147483647
Copy link
Contributor Author

No worries, we all have our own lives.


I've just implemented it and tested locally. Could you run the ci?

@Guts
Copy link
Owner

Guts commented Mar 23, 2023

Perfect!

Let's merge it!

I'm waiting for #177 to release a new version.

@Guts Guts enabled auto-merge March 23, 2023 15:13
@Guts Guts merged commit ae9ae8f into Guts:main Mar 23, 2023
@YDX-2147483647 YDX-2147483647 deleted the doc branch March 23, 2023 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants