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

fix: Additional dependencies for development #6085 #6125

Merged
merged 5 commits into from
Oct 3, 2023
Merged

fix: Additional dependencies for development #6085 #6125

merged 5 commits into from
Oct 3, 2023

Conversation

alexvoss
Copy link
Sponsor Collaborator

@alexvoss alexvoss commented Oct 3, 2023

I added instructions for working on Insiders and also changed the instructions for installing optional dependencies to use the definitions in pyproject.toml.

As I keep forgetting to activate a venv and end up installing things globally, I added a note about getting pip to refuse installing things outside a venv. Seems I am not the only person who keeps making that mistake, so I thought it would be useful for people here as many of our customers will not be hard-core Pythonistas.

Hope this fits the bill. I got stuck on this a little bit because I looked for ways to make things run on Windows but that is a battle we can fight another day, perhaps when we find someone who is native in that environment.

also added a note about how to prevent installing things outside a venv,
which I hope will be useful to people
Copy link
Owner

@squidfunk squidfunk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Only some minor changes.

docs/customization.md Outdated Show resolved Hide resolved
docs/customization.md Outdated Show resolved Hide resolved
docs/customization.md Outdated Show resolved Hide resolved
- clarified language about access to Insiders
- let's not suggest SSH access
- better heading for note on getting pip to work in venv only
@@ -263,15 +264,6 @@ that you need to be a member of [Insiders] to access its repository.

[as described in the Insiders documentation]: insiders/getting-started.md#requirements

=== "Insiders (with SSH key)"
Copy link
Owner

@squidfunk squidfunk Oct 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to put that into a code annotation, similar to the section below. Sorry if this was unclear. It's definitely valuable information and we should mention it, but I'd regard it as side content to the interested reader:
https://squidfunk.github.io/mkdocs-material/getting-started/#with-pip-9x

Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, you mean like so?

=== "Insiders"
    
    You will need to have a GitHub access token [as described in the
    Insiders documentation] and make it available in the `$GH_TOKEN`
    variable. 
  
    ``` sh
    git clone https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git # (1)!
    ```

    1. If you are using SSH keys for authenticating with GitHub, you can
       clone Insiders with this command:
       ```
       git clone git@github.com:squidfunk/mkdocs-material-insiders.git
       ``` 
       
    [as described in the Insiders documentation]: insiders/getting-started.md#requirements

I had to remove the line before the code snippet in the annotation to force it to be rendered inside the annotation and not as a next line. The documentation for the code annotation feature does not say anything about the rules for defining the annotation? Is this down to indentation? (may need to better learn Markdown's rules on that)

Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've gone and pushed this version, hope it fits the bill.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove the line before the code snippet in the annotation to force it to be rendered inside the annotation and not as a next line. The documentation for the code annotation feature does not say anything about the rules for defining the annotation?

I think this happens because you need to indent by four spaces, not three, like so:

=== "9.x"
``` sh
pip install mkdocs-material=="9.*" # (1)!
```
1. Material for MkDocs uses [semantic versioning][^2], which is why it's a
good idea to limit upgrades to the current major version.
This will make sure that you don't accidentally [upgrade to the next
major version], which may include breaking changes that silently corrupt
your site. Additionally, you can use `pip freeze` to create a lockfile,
so builds are reproducible at all times:
```
pip freeze > requirements.txt
```
Now, the lockfile can be used for installation:
```
pip install -r requirements.txt
```

Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, that fixed it. It might be an idea to create an example for this that points these subtleties out? (I will try to push a branch with some examples tomorrow, I hope)

@squidfunk squidfunk merged commit 6990976 into squidfunk:master Oct 3, 2023
4 checks passed
@squidfunk
Copy link
Owner

Thanks! LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants