Restore __version__ attributes in modules
Marco Ricci

Marco Ricci commited on 2024-07-14 15:00:43
Zeige 3 geänderte Dateien mit 5 Einfügungen und 5 Löschungen.


Version 0.1.0 included broken references to the `__version__` attribute
in other modules, most importantly in the command-line interface.  In
the README, we mention that we support copying the files into the target
directory.  The command-line interface will then have no installed
package to query for its version number.

Fix this by re-duplicating the version number in the `__version__`
attribute, manually, across all top-level modules.

In the long run, we either want Hatchling to support writing the version
back to multiple files, or we want to write a script or hook script that
accomplishes this ourselves, or perhaps we want to publish `sequin` and
`ssh_agent_client` as separate packages so they get their own version
number.  Until then, manually duplicating the number to the top-level
modules is an acceptable compromise to me.
... ...
@@ -20,7 +20,7 @@ import sequin
20 20
 import ssh_agent_client
21 21
 
22 22
 __author__ = "Marco Ricci <m@the13thletter.info>"
23
-# Use importlib.metadata.version(...) to query the version.
23
+__version__ = "0.1.0"
24 24
 
25 25
 class AmbiguousByteRepresentationError(ValueError):
26 26
     """The object has an ambiguous byte representation."""
... ...
@@ -27,8 +27,8 @@ from collections.abc import Iterator, Sequence
27 27
 from typing_extensions import assert_type
28 28
 
29 29
 __all__ = ('Sequin', 'SequinExhaustedError')
30
-__author__ = 'Marco Ricci <m@the13thletter.info>'
31
-# Use importlib.metadata.version(...) to query the version.
30
+__author__ = "Marco Ricci <m@the13thletter.info>"
31
+__version__ = "0.1.0"
32 32
 
33 33
 class Sequin:
34 34
     """Generate pseudorandom non-negative numbers in different ranges.
... ...
@@ -17,8 +17,8 @@ from typing_extensions import Any, Self
17 17
 from ssh_agent_client import types
18 18
 
19 19
 __all__ = ('SSHAgentClient',)
20
-__author__ = 'Marco Ricci <m@the13thletter.info>'
21
-# Use importlib.metadata.version(...) to query the version.
20
+__author__ = "Marco Ricci <m@the13thletter.info>"
21
+__version__ = "0.1.0"
22 22
 
23 23
 _socket = socket
24 24
 
25 25