Commit 0b210a1
authored
Merge pull request #1026 from cderici/resolve-build-problems-3.3.1.0
#1026
#### Description
This solves 2 problems with the latest release (also described in [this comment](#1025 (comment))):
1. We depend on the `packaging` module, but didn't include it in the `setup.py` (because our testing and dev environments have tox installed and tox satisfies that requirement for itself, so we didn't notice).
2. We [accidentally depend](https://github.com/juju/python-libjuju/blob/905de781cb92041dcae158412861464d87a8bb77/juju/version.py#L18) on the static [VERSION ](https://github.com/juju/python-libjuju/blob/master/VERSION) file where we keep track of the version of pylibjuju.
This change fixes #1025, solving these issues by:
1. Adding the `packaging` to the required modules.
2. Removing the file `VERSION`, and moving the static version information into the `version.py` module (just like in Juju) and use that information from there. The places that dynamically use that information (outside of the juju modules) are i) `setup.py` to get the version info into the build, ii) `Makefile` to use it in the release target iii) `docs/config.py` for building the docs. All of these spots are updated to use the info within the `version.py`.
#### QA Steps
We'll use the steps described in #1025. After pulling the branch in this PR;
- Create a new virtual env:
```
python -m venv venv
```
- Activate it:
```
source venv/bin/activate
```
- Build pylibjuju at this spot:
```
python setup.py sdist
```
- The sdist build will create a `dist/juju-3.3.1.0.tar.gz`, so install that:
```
pip install dist/juju-3.3.1.0.tar.gz
```
- Now try to import a `Controller`.
```
python3 -c "from juju.controller import Controller"
```
Without the (1)st change in this PR, this command would result in:
```
ModuleNotFoundError: No module named 'packaging'
```
And without the (2)nd change, this command would error with
```
FileNotFoundError: [Errno 2] No such file or directory: '......./venv/lib/python3.10/site-packages/VERSION'
```
But with this change, we shouldn't see either (or any other) error. I.e., the command should succeed with no problems.
#### Notes & Discussion
Note that this changes the release process. In particular where we need to manually change the version information is moved into the `version.py` module (the release process document will be updated right before this PR is merged).
Moreover, we need to make a patch release (`3.3.1.1`) after this for these changes to take effect (i.e. for pylibjuju to be usable in the environments where it's installed as a dependency).
JUJU-54848 files changed
Lines changed: 14 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
0 commit comments