Skip to content

Commit

Permalink
Merge pull request #851 from glitch/508_versioneer
Browse files Browse the repository at this point in the history
Issue #508: Adding versioneer to project for version management.
  • Loading branch information
mhmerrill authored Jun 29, 2021
2 parents 748791c + 2f5a2a7 commit 475581b
Show file tree
Hide file tree
Showing 13 changed files with 2,476 additions and 33 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
arkouda/_version.py export-subst
3 changes: 2 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y python3-pip libhdf5-dev hdf5-tools libzmq3-dev
python3 -m pip install types-pkg_resources
python3 -m pip install types-pkg_resources versioneer
python3 -m pip install -e .[dev]
- name: Arkouda mypy
run: |
Expand All @@ -38,6 +38,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y python3-pip libhdf5-dev hdf5-tools libzmq3-dev
python3 -m pip install versioneer
python3 -m pip install -e .[dev]
- name: Arkouda make doc
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y python3-pip rsync libhdf5-dev hdf5-tools libzmq3-dev
python3 -m pip install versioneer
python3 -m pip install -e .[dev]
- name: Arkouda make doc
run: |
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ include LICENSE
include Makefile
include VERSION
include setup.py
include installers.py
include installers.pyinclude versioneer.py
include arkouda/_version.py
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ endef
$(eval $(call create_help_target,arkouda-help,ARKOUDA_HELP_TEXT))

# Set the arkouda server version from the VERSION file
VERSIONFILE=./VERSION
VERSION=$(shell python -c "import versioneer; print(versioneer.get_versions()[\"version\"])")
# Test for existence of VERSION file
ifneq ("$(wildcard $(VERSIONFILE))","")
VERSION=$(shell cat ${VERSIONFILE})
else
VERSION=$(shell date +'%Y.%m.%d')
endif
# ifneq ("$(wildcard $(VERSIONFILE))","")
# VERSION=$(shell cat ${VERSIONFILE})
# else
# VERSION=$(shell date +'%Y.%m.%d')
# endif

# Version needs to be escape-quoted for chpl to interpret as string
CHPL_FLAGS_WITH_VERSION = $(CHPL_FLAGS)
Expand Down
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ This yielded a >20TB dataframe in Arkouda.
6. [Logging](#log-ak)
7. [Type Checking in Arkouda](#typecheck-ak)
8. [Environment Variables](#env-vars-ak)
9. [Contributing](#contrib-ak)
9. [Versioning](#versioning-ak)
10. [Contributing](#contrib-ak)


<a id="prereq-main"></a>
Expand All @@ -124,6 +125,7 @@ This yielded a >20TB dataframe in Arkouda.
* requires pandas for testing and conversion utils
* requires pytest, pytest-env, and h5py to execute the Python test harness
* requires sphinx, sphinx-argparse, and sphinx-autoapi to generate docs
* requires versioneer for versioning

<a id="prereq-mac"></a>
### MacOS Environment <sup><sup><sub><a href="#toc">toc</a></sub></sup></sup>
Expand Down Expand Up @@ -188,6 +190,11 @@ source ~/.bashrc
# Otherwise, Python 3 can be installed with brew
brew install python3
# versioneer is required, use either conda or pip
pip install versioneer
or
conda install versioneer
# these packages are nice but not a requirement (manual install required if Python installed with brew)
pip3 install pandas
pip3 install jupyter
Expand Down Expand Up @@ -250,6 +257,13 @@ As is the case with the MacOS install, it is highly recommended to [install Anac
wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
sh Anaconda3-2020.07-Linux-x86_64.sh
source ~/.bashrc
# Install versioneer and other required python packages if they are not included in yoru anaconda install
conda install versioneer
or
pip install versioneer
# Repeat for any missing pacakges using your package manager of choice (conda or pip)
```

</details>
Expand Down Expand Up @@ -417,7 +431,7 @@ Alternatively you can build a distributable package via
# We'll use a virtual environment to build
python -m venv build-client-env
source build-client-env/bin/activate
python -m pip install --upgrade pip build wheel
python -m pip install --upgrade pip build wheel versioneer
python setup.py clean --all
python -m build

Expand Down Expand Up @@ -594,6 +608,54 @@ type checking require type hints. Consequently, to opt-out of type checking, sim
The various Arkouda aspects (compilation, run-time, client, tests, etc.) can be configured using a number of environment
variables (env vars). See the [ENVIRONMENT](ENVIRONMENT.md) documentation for more details.

<a id="versioning-ak"></a>
## Versioning <sup><sup><sub><a href="#toc">toc</a></sub></sup></sup>
Beginning after tag `v2019.12.10` versioning is now performed using [Versioneer](https://github.com/python-versioneer/python-versioneer)
which determines the version based on the location in `git`.

An example using a hypothetical tag `1.2.3.4`
```bash
git checkout 1.2.3.4
python -m arkouda |tail -n 2
>> Client Version: 1.2.3.4
>> 1.2.3.4

# If you were to make uncommitted changes and repeat the command you might see something like:
python -m arkouda|tail -n 2
>> Client Version: 1.2.3.4+0.g9dca4c8.dirty
>> 1.2.3.4+0.g9dca4c8.dirty

# If you commit those changes you would see something like
python -m arkouda|tail -n 2
>> Client Version: 1.2.3.4+1.g9dca4c8
>> 1.2.3.4+1.g9dca4c8
```
In the hypothetical cases above _Versioneer_ tells you the version and how far / how many commits beyond the tag your repo is.

When building the server-side code the same versioning information is included in the build. If the server and client do not
match you will receive a warning. For developers this is a useful reminder when you switch branches and forget to rebuild.

```bash
# Starting the arkouda when built from tag 1.2.3.4 shows the following in the startup banner
arkouda server version = 1.2.3.4

# If you built from an arbitrary branch the version string is based on the derived coordinates from the "closest" tag
arkouda server version = v2019.12.10+1679.abc2f48a

# The .dirty extension denotes a build from uncommitted changes, or a "dirty branch" in git vernacular
arkouda server version = v2019.12.10+1679.abc2f48a.dirty
```

For maintainers, creating a new version is as simple as creating a tag in the repository; i.e.
```bash
git checkout master
git tag 1.2.3.4
python -m arkouda |tail -n 2
>> Client Version: 1.2.3.4
>> 1.2.3.4
git push --tags
```

<a id="contrib-ak"></a>
## Contributing to Arkouda <sup><sup><sub><a href="#toc">toc</a></sub></sup></sup>

Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

5 changes: 5 additions & 0 deletions arkouda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions

from arkouda.client import *
from arkouda.dtypes import *
from arkouda.pdarrayclass import *
Expand All @@ -13,3 +17,4 @@
from arkouda.logger import *
from arkouda.timeclass import *
from arkouda.infoclass import *

Loading

0 comments on commit 475581b

Please sign in to comment.