Skip to content

Commit

Permalink
Merge pull request #85 from dpgrote/change_the_versioning
Browse files Browse the repository at this point in the history
Change the versioning
  • Loading branch information
ax3l authored Mar 14, 2023
2 parents 854ab37 + 147e470 commit a43fc54
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 5 additions & 4 deletions PICMI_Python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,21 @@ Some packages specify the version of the standard that is to be used. For new fe
be updated. The update has several steps, updating the version number, adding a tag, pushing the changes, and updating the version
of PyPI.

Currently, the version number is modified by hand by modifying the number in the setup.py file, incrementing the third
number. After changing the file, make a commit with the change with a comment like "Version 0.0.16", updating the number of course.
Currently, the version number is modified by hand by modifying the number in the `version.py` file, incrementing the second
number, the minor release version. After changing the file, make a commit with the change with a comment like "Release 0.22.0",
updating the version number of course.
Please don't make any other changes in the commit. Note that it is ok to push a version update directly to the main branch assuming
it has been approved.

Next, add a tag and push the changes to the repo:

```
git tag -a 0.0.16 -m "Release 0.0.16"
git tag -a 0.22.0 -m "Release 0.22.0"
git push origin
git push origin --tags
```

Change the tag number as needed.
Change the tag number as needed to match the version number.

The final step is to update the version on PyPI. It is recommended to use the twine command. Here are the commands:

Expand Down
2 changes: 2 additions & 0 deletions PICMI_Python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from .version import __version__

from .base import *
from .diagnostics import *
from .fields import *
Expand Down
4 changes: 3 additions & 1 deletion PICMI_Python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

from setuptools import setup

import version

# Read the package requirements from the requirements.txt file
with open('requirements.txt') as f:
install_requires = [ line.strip('\n') for line in f.readlines() ]

setup(name = 'picmistandard',
version = '0.0.22',
version = version.__version__,
description = 'Python base classes for PICMI standard',
platforms = 'any',
packages = ['picmistandard'],
Expand Down
1 change: 1 addition & 0 deletions PICMI_Python/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.22.0'

0 comments on commit a43fc54

Please sign in to comment.