Re: Embedding version in command-line program

2020-10-20 Thread Loris Bennett
"Loris Bennett" writes: > Tony Flury writes: > >> On 07/10/2020 12:06, Loris Bennett wrote: >>> Hi, >>> >>> I have written a program, which I can run on the command-line thus >>> >>>mypyprog --version >>> >>> and the get the version, which is currently derived from a variable in >>> the main

Re: Embedding version in command-line program

2020-10-19 Thread Loris Bennett
Tony Flury writes: > On 07/10/2020 12:06, Loris Bennett wrote: >> Hi, >> >> I have written a program, which I can run on the command-line thus >> >>mypyprog --version >> >> and the get the version, which is currently derived from a variable in >> the main module file. >> >> However, I also ha

Re: Embedding version in command-line program

2020-10-17 Thread Tony Flury via Python-list
On 07/10/2020 12:06, Loris Bennett wrote: Hi, I have written a program, which I can run on the command-line thus mypyprog --version and the get the version, which is currently derived from a variable in the main module file. However, I also have the version in an __init__.py file and in

Re: Embedding version in command-line program

2020-10-12 Thread Loris Bennett
Hi Heinrich, Heinrich Kruger writes: > ‐‐‐ Original Message ‐‐‐ > On Thursday, October 8, 2020 2:00 PM, Loris Bennett > wrote: > >> Marco Sulla marco.sulla.pyt...@gmail.com writes: >> >> > On Wed, 7 Oct 2020 at 14:16, Loris Bennett loris.benn...@fu-berlin.de >> > wrote: >> > >> > > But

Re: Embedding version in command-line program

2020-10-09 Thread Heinrich Kruger
‐‐‐ Original Message ‐‐‐ On Thursday, October 8, 2020 2:00 PM, Loris Bennett wrote: > Marco Sulla marco.sulla.pyt...@gmail.com writes: > > > On Wed, 7 Oct 2020 at 14:16, Loris Bennett loris.benn...@fu-berlin.de > > wrote: > > > > > But the toml file isn't part of the distribution and so

Re: Embedding version in command-line program

2020-10-08 Thread Loris Bennett
Marco Sulla writes: > On Wed, 7 Oct 2020 at 14:16, Loris Bennett > wrote: > >> But the toml file isn't part of the distribution and so it won't be >> installed. >> >> I suppose I could write a separate program which parses the toml file >> and then just injects the version into __init__.py. > >

Re: Embedding version in command-line program

2020-10-07 Thread Loris Bennett
Hi Marco, Marco Sulla writes: > In __init__.py, you can parse the toml file, extract the version and > store it in a __version__ variable. But the toml file isn't part of the distribution and so it won't be installed. I suppose I could write a separate program which parses the toml file and th

Re: Embedding version in command-line program

2020-10-07 Thread Marco Sulla
On Wed, 7 Oct 2020 at 14:16, Loris Bennett wrote: > But the toml file isn't part of the distribution and so it won't be > installed. > > I suppose I could write a separate program which parses the toml file > and then just injects the version into __init__.py. Yes, I do not know poetry, but I sup

Re: Embedding version in command-line program

2020-10-07 Thread Marco Sulla
In __init__.py, you can parse the toml file, extract the version and store it in a __version__ variable. -- https://mail.python.org/mailman/listinfo/python-list

Embedding version in command-line program

2020-10-07 Thread Loris Bennett
Hi, I have written a program, which I can run on the command-line thus mypyprog --version and the get the version, which is currently derived from a variable in the main module file. However, I also have the version in an __init__.py file and in a pyproject.toml (as I'm using poetry, otherwis