Skip to content

Commit b3013ed

Browse files
committed
Move to month
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
1 parent 3d8fa43 commit b3013ed

File tree

10 files changed

+742
-204
lines changed

10 files changed

+742
-204
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- repo: https://github.com/rbubley/mirrors-prettier
8+
rev: "v3.3.3"
9+
hooks:
10+
- id: prettier
11+
exclude: layouts/shortcodes/project.html|layouts/shortcodes/img.html
12+
additional_dependencies:
13+
- prettier@3.3.3
14+
- "@prettier/plugin-xml@3.4.1"
15+
args: ["--print-width=120", "--prose-wrap=always"]

assets/css/syntax.css

Lines changed: 677 additions & 170 deletions
Large diffs are not rendered by default.

content/about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ For the following projects, while I do hold the write commit bit, I only help wi
3939

4040
1. {{< project name="build" org="pypa" ci="test">}}
4141
1. {{< project name="pytest-memray" org="bloomberg" ci="build">}}
42-
1. {{< project name="tox-conda" org="tox-dev" ci="check">}}
4342
1. {{< project name="ipydatagrid" org="jupyter-widgets" ci="check">}}
43+
1. {{< project name="tox-conda" org="tox-dev" ci="check">}}
4444
1. {{< project name="attrs-strict" org="bloomberg" ci="check">}}
4545

4646
You can find my Curriculum Vitae (or résumé) on the following link

content/posts/pep-517-518/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ title = "Python packaging - Past, Present, Future"
1212
Have you ever wondered what happens exactly when you run pip install? This post will give you a detailed overview of the
1313
steps involved in the past, and how it all changes with the adoption of PEP-517 and PEP-518.
1414

15-
[In my previous post]({{< ref "pep-517-and-python-packaging" >}}) I've described how it's possible to install three
16-
types of content: source tree, source distribution, and wheels. Only the last two types are uploaded to PyPI, the
17-
central Python repository. However, one could get its hands on a source tree (by feeding, for example, a git protocol
18-
for pip). The advantage of wheels over the others is that it does not require any build operation to happen on the user
19-
machine; it's just downloading and extract.
15+
[In my previous post]({{< ref "pep-517-and-python-packaging" >}}) I've described how it's possible to install three types
16+
of content: source tree, source distribution, and wheels. Only the last two types are uploaded to PyPI, the central Python
17+
repository. However, one could get its hands on a source tree (by feeding, for example, a git protocol for pip). The advantage
18+
of wheels over the others is that it does not require any build operation to happen on the user machine; it's just downloading
19+
and extract.
2020

2121
## Building python packages
2222

@@ -222,7 +222,7 @@ builds. The specifications for these standards were written up and debated in lo
222222
proposals were deemed good enough to benefit the most, but some less mainstream use cases could have been overlooked.
223223

224224
If your use case is such, don't worry the PEPs are open to enhancement at any point if we deem required. [In my next
225-
post of this series here]({{< ref "growing-pain" >}}) I'll go over some of the pain points the community bumped into
226-
while releasing these two PEPs. These should serve as lessons learned and show that there's still some work to be done.
227-
It's not everything perfect yet. However, we're getting better. Join the packaging community if you can help out, and
228-
let's make things better together!
225+
post of this series here]({{< ref "growing-pain" >}}) I'll go over some of the pain points the community bumped into while
226+
releasing these two PEPs. These should serve as lessons learned and show that there's still some work to be done. It's not
227+
everything perfect yet. However, we're getting better. Join the packaging community if you can help out, and let's make things
228+
better together!

content/posts/pep-517-and-python-packaging/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,5 +227,5 @@ The difference between a source tree, a source distribution, and a wheel:
227227

228228
{{< figure src="smart_pug.webp">}}
229229

230-
[Read the next post of the series here]({{< ref "pep-517-518" >}}) to determine what happens when we install a package.
231-
Thanks for reading!
230+
[Read the next post of the series here]({{< ref "pep-517-518" >}}) to determine what happens when we install a package. Thanks
231+
for reading!

content/posts/type-hints/index.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,16 @@ The upside of this is that:
423423
Now there are also some hefty penalties to pay:
424424

425425
<div class='cross'>
426-
427-
- You just duplicated your codebase, as every function now has two definitions (note you don't need to replicate your body or default arguments, the ``...`` - ellipsis - is used as a placeholder for these).
428-
- Now, you have some extra files that need to be packaged and shipped with your code.
429-
- It's impossible to annotate contents inside functions (this means both methods inside methods and local variables).
430-
- There is no check that your implementation file matches your stub's signature (furthermore, IDEs always use the stub definition).
431-
- However, the heaviest penalty is that you cannot type check the code you're type hinting via a stub. Stub file type hints were designed to be used to type-check code that uses the library. But not too type check the codebase itself what your type hinting.
426+
427+
- You just duplicated your codebase, as every function now has two definitions (note you don't need to replicate your
428+
body or default arguments, the `...` - ellipsis - is used as a placeholder for these).
429+
- Now, you have some extra files that need to be packaged and shipped with your code.
430+
- It's impossible to annotate contents inside functions (this means both methods inside methods and local variables).
431+
- There is no check that your implementation file matches your stub's signature (furthermore, IDEs always use the stub
432+
definition).
433+
- However, the heaviest penalty is that you cannot type check the code you're type hinting via a stub. Stub file type
434+
hints were designed to be used to type-check code that uses the library. But not too type check the codebase itself what
435+
your type hinting.
432436
</div>
433437

434438
The last two drawback makes it incredibly hard to check that the type hinted codebase via a stub file is in sync or not.
@@ -912,10 +916,10 @@ things:
912916
- finally, appending to the correct parameter into the docstring.
913917
914918
For example `Any` maps to `` py:data:`~typing.Any` ``. Things can get even more complicated for compound types such as
915-
`Mapping[str, bool]` needs to be translated for example too
916-
`` :class:`~typing.Mapping`\\[:class:`str`, :class:`bool`] ``. Getting the translation here right (e.g. having `class`
917-
or `data` namespace) is essential so that the `intersphinx` plugin will work correctly (a plugin that links types
918-
directly to their respective Python standard library documentation link).
919+
`Mapping[str, bool]` needs to be translated for example too ``:class:`~typing.Mapping`\\[:class:`str`, :class:`bool`]``.
920+
Getting the translation here right (e.g. having `class` or `data` namespace) is essential so that the `intersphinx`
921+
plugin will work correctly (a plugin that links types directly to their respective Python standard library documentation
922+
link).
919923
920924
In order to use it one needs to install it via `pip install sphinx-autodoc-types>=2.1.1` and then enable in inside the
921925
`conf.py` file:

layouts/shortcodes/img.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{{/* only use images smaller than or equal to the src (original) image size, as Hugo will upscale small images */}}
2727
{{/* set the sizes attribute to (min-width: 35em) 1200px, 100vw unless overridden in shortcode */}}
2828

29-
<img
29+
<img
3030
{{ with .Get "sizes" }}sizes='{{.}}'{{ else }}sizes="(min-width: 35em) 1200px, 100vw"{{ end }}
3131
srcset='
3232
{{ if ge $src.Width "500" }}
@@ -42,8 +42,8 @@
4242
{{ with $large.RelPermalink }}, {{.}} 1500w {{ end }}
4343
{{ end }}'
4444
{{ if .Get (print $medium) }}
45-
src="{{ $medium.RelPermalink }}"
45+
src="{{ $medium.RelPermalink }}"
4646
{{ else }}
47-
src="{{ $src.RelPermalink }}"
47+
src="{{ $src.RelPermalink }}"
4848
{{ end }}
49-
{{ with .Get "alt" }}alt="{{.}}"{{ else }}alt=""{{ end }}>
49+
{{ with .Get "alt" }}alt="{{.}}"{{ else }}alt=""{{ end }}>

layouts/shortcodes/project.html

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
1-
<a href="https://pepy.tech/project/{{.Get "name"}}" target="_blank" rel="noopener"><img src="https://static.pepy.tech/badge/{{.Get "name"}}/week" alt="PyPI - Downloads"></a>
2-
<a href="https://github.com/{{.Get "org"}}/{{.Get "name"}}/actions/workflows/{{.Get "ci"}}.yml" target="_blank" rel="noopener"><img src="https://github.com/{{.Get "org"}}/{{.Get "name"}}/actions/workflows/{{.Get "ci"}}.yml/badge.svg" alt="check"></a>
1+
<a href="https://github.com/{{.Get "org"}}/{{.Get "name"}}/actions/workflows/{{.Get "ci"}}.yml" target="_blank" rel="noopener">
2+
<img src="https://github.com/{{.Get "org"}}/{{.Get "name"}}/actions/workflows/{{.Get "ci"}}.yml/badge.svg" alt="check">
3+
</a>
4+
5+
<a href="https://pypi.org/project/{{.Get "name"}}" target="_blank" rel="noopener">
6+
<img src="https://img.shields.io/pypi/v/{{.Get "name"}}?style=flat-square" alt="PyPI">
7+
</a>
8+
9+
<a href="https://pepy.tech/project/{{.Get "name"}}" target="_blank" rel="noopener">
10+
<img src="https://static.pepy.tech/badge/{{.Get "name"}}/month" alt="PyPI - Downloads">
11+
</a>
12+
13+
<a href="https://github.com/{{.Get "org"}}/{{.Get "name"}}/commits">
314
<img src="https://img.shields.io/github/last-commit/{{.Get "org"}}/{{.Get "name"}}?logo=python&amp;style=flat-square" alt="GitHub last commit">
4-
<a href="https://pypi.org/project/{{.Get "name"}}" target="_blank" rel="noopener"><img src="https://img.shields.io/pypi/v/{{.Get "name"}}?style=flat-square" alt="PyPI"></a>
5-
<a href="https://github.com/{{.Get "org"}}/{{.Get "name"}}">{{.Get "name"}}</a>
15+
</a>
16+
17+
<a href="https://github.com/{{.Get "org"}}/{{.Get "name"}}">
18+
{{.Get "name"}}
19+
</a>
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
<div class="toc">
2-
{{ .Page.TableOfContents }}
3-
</div>
1+
<div class="toc">{{ .Page.TableOfContents }}</div>

themes/hugo-coder

Submodule hugo-coder updated 35 files

0 commit comments

Comments
 (0)