Skip to content

Commit 2267c3c

Browse files
Updated to match Vonage release process (#190)
1 parent d7607c1 commit 2267c3c

File tree

8 files changed

+90
-29
lines changed

8 files changed

+90
-29
lines changed

.bumpversion.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[bumpversion]
2+
current_version = 3.1.0
3+
commit = True
4+
tag = False
5+
6+
[bumpversion:file:opentok/version.py]

.github/workflows/ot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python-version: [2.7, 3.5, 3.6, 3.7]
11+
python-version: [3.5, 3.6, 3.7, 3.8.8, 3.9]
1212

1313
steps:
1414
- uses: actions/checkout@v2

DEVELOPING.md

Lines changed: 51 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,30 @@ this project. If you use this package within your own software as is but don't p
1616
location on your system, which helps keep you out of dependency hell. You can exit the
1717
environment using `$ deactivate`.
1818

19-
* [tox](https://testrun.org/tox/): a testing automation tool that can load many Python versions.
20-
This tool allows the project to test against all the compatible versions of Python by leveraging
21-
virtualenv and describing the tasks in a metadata file.
19+
* [act](https://github.com/nektos/act): a tool for running Github Actions locally. This tool allows
20+
developers to easily replicate the same Continuous Integration pipelines we use for code validation.
2221

2322
## Tasks
2423

24+
## Setup
25+
26+
We currently recommend setting up a development environment using `virtualenv` and installing dependencies
27+
with `pip`. While the Python Packaging Authority recommends `Pipenv` to manage dependencies, `Pipenv` does
28+
not install the OpenTok library correctly from source at this time.
29+
30+
We recommend setting up a Python 3.5 or higher `virtualenv` environment. This allows you to isolate dependencies
31+
for work on the OpenTok library without interfering with any other projects or installations on your system.
32+
33+
$ virtualenv env
34+
$ source env/bin/activate
35+
$ pip install -r requirements.txt -r test_requirements.txt
36+
37+
Some IDEs, like Visual Studio Code, will automatically detect the `virtualenv` and use it.
38+
39+
When you are done, you can leave the `virtualenv` by deactivating it:
40+
41+
$ deactivate
42+
2543
### Building
2644

2745
Building isn't necessarily required for a python package, but it is possible. By running the command
@@ -32,10 +50,19 @@ other script in your environment, and continue to update and you make changes.
3250

3351
### Testing
3452

35-
This project's tests are kicked off by tox. The `tox.ini` file describes the automation. In
36-
a nutshell, it selects a Python version, installs test dependencies stored in
37-
`test_requirements.txt`, and then runs `nosetests`. [Nose](https://nose.readthedocs.org) is the
38-
actual test runner. All of this can be ran using the following command: `$ tox`
53+
This project's tests are built using the `unittest` [`Nose'](https://nose.readthedocs.org) modules.
54+
To run the unit tests, install the core as well as development dependencies inside your `virtualenv`:
55+
56+
$ pip install -r requirements.txt -r test_requirements.txt
57+
58+
You can manually run the test suite for your version of python with:
59+
60+
$ nosetests
61+
62+
If you would like to run the test suite against a variety of Python versions, we recommend installing
63+
`act` and running out Github Action "test" workflow:
64+
65+
$ act --quiet
3966

4067
### Generating Documentation
4168

@@ -45,19 +72,28 @@ actual test runner. All of this can be ran using the following command: `$ tox`
4572

4673
In order to create a release, the following should be completed in order.
4774

48-
1. Ensure all tests are passing (`tox`) and that there is enough test coverage.
75+
#### Prep the release
76+
77+
1. Ensure all tests are passing (`act`) and that there is enough test coverage.
4978
1. Make sure you are on the `master` branch of the repository, with all changes merged/committed already.
50-
1. Update the version number in the source code (`opentok/version.py`) and the README. See [Versioning](#versioning) for
79+
1. Create a new branch named `release-x.y.z`, with the release version number
80+
1. Update the version number with `bumpversion`. See [Versioning](#versioning) for
5181
information about selecting an appropriate version number.
5282
1. Commit the version number change with the message ("Update to version v.x.x.x"), substituting the new version number.
83+
1. Create a new pull request with this branch
84+
85+
#### Once PR is merged into `master`
86+
1. Make sure you are on the `master` branch of the repository
87+
1. Run `git pull --rebase origin master` to make sure your local code is up-to-date
5388
1. Create a git tag: `git tag -a vx.y.z -m "Release vx.y.z"`
89+
1. Run `git push origin vx.y.z` to push the tag to Github
5490
1. Ensure you have permission to update the `opentok` package on PyPI: <https://pypi.python.org/pypi/opentok>.
55-
1. Run `python setup.py sdist upload`, which will build and upload the package to PyPI.
56-
1. Change the version number for future development by adding "a1", then make another commit with the message
57-
"Beginning development on next version".
58-
1. Push the changes to the main repository (`git push origin master`).
59-
1. Upload the `dist/opentok-x.y.z.tar.gz` file to the
60-
[Github Releases](https://github.com/opentok/opentok-python-sdk/releases) page with a description and release notes.
91+
1. Run the deploy scripts:
92+
1. `make clean`
93+
1. `make dist`
94+
1. `make release`
95+
1. Create a new release on the [Github Releases](https://github.com/opentok/opentok-python-sdk/releases) page,
96+
and attach the files in `dist/` to the release
6197

6298
## Workflow
6399

@@ -73,10 +109,6 @@ from 1.
73109
### Branches
74110

75111
* `master` - the main development branch.
76-
* `feat.foo` - feature branches. these are used for longer running tasks that cannot be accomplished in one commit.
77-
once merged into master, these branches should be deleted.
78-
* `vx.x.x` - if development for a future version/milestone has begun while master is working towards a sooner
79-
release, this is the naming scheme for that branch. once merged into master, these branches should be deleted.
80112

81113
### Tags
82114

Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.PHONY: clean test dist coverage install requirements release release-test
2+
3+
clean:
4+
rm -rf dist build
5+
6+
coverage:
7+
pytest -v --cov
8+
coverage html
9+
10+
test:
11+
nosetests -v
12+
13+
dist:
14+
python setup.py sdist --formats zip,gztar bdist_wheel
15+
16+
release:
17+
twine upload dist/*
18+
19+
install: requirements
20+
21+
requirements: .requirements.txt
22+
23+
.requirements.txt: requirements.txt
24+
python -m pip install --upgrade pip setuptools
25+
python -m pip install -r requirements.txt
26+
python -m pip freeze > .requirements.txt

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ Requirements
502502

503503
You need an OpenTok API key and API secret, which you can obtain at https://dashboard.tokbox.com/
504504

505-
The OpenTok Python SDK requires Python 2.6, 2.7, 3.3, 3.4, 3.5 or 3.6
505+
The OpenTok Python SDK requires Python 3.5 or higher
506506

507507
Release Notes
508508
-------------

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ def find_version(*file_paths):
6262
'License :: OSI Approved :: MIT License',
6363

6464
'Programming Language :: Python :: 3',
65-
'Programming Language :: Python :: 3.3',
66-
'Programming Language :: Python :: 3.4',
6765
'Programming Language :: Python :: 3.5',
6866
'Programming Language :: Python :: 3.6',
67+
'Programming Language :: Python :: 3.7',
68+
'Programming Language :: Python :: 3.8',
69+
'Programming Language :: Python :: 3.9',
6970

7071
'Topic :: Communications',
7172
'Topic :: Communications :: Chat',

test_requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ nose
22
httpretty
33
expects
44
wheel
5+
twine
6+
bump2version

tox.ini

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)