mirror of
https://github.com/planetmint/planetmint.git
synced 2026-03-21 15:48:45 +00:00
Fixes issue #15. All tests successful with Python3.9. Review required though
This commit is contained in:
@@ -42,7 +42,7 @@ This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior directed at yourself or another community member may be
|
||||
reported by contacting a project maintainer at [contact@bigchaindb.com](mailto:contact@bigchaindb.com). All
|
||||
reported by contacting a project maintainer at [contact@planetmint.com](mailto:contact@planetmint.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is appropriate to the circumstances. Maintainers are
|
||||
obligated to maintain confidentiality with regard to the reporter of an
|
||||
|
||||
@@ -16,7 +16,7 @@ Our starting point is [PEP8](https://www.python.org/dev/peps/pep-0008/), the sta
|
||||
Planetmint uses Python 3.5+, so you can ignore all PEP8 guidelines specific to Python 2.
|
||||
|
||||
We use [pre-commit](http://pre-commit.com/) to check some of the rules below before every commit but not everything is realized yet.
|
||||
The hooks we use can be found in the [.pre-commit-config.yaml](https://github.com/bigchaindb/bigchaindb/blob/master/.pre-commit-config.yaml) file.
|
||||
The hooks we use can be found in the [.pre-commit-config.yaml](https://github.com/planetmint/planetmint/blob/master/.pre-commit-config.yaml) file.
|
||||
|
||||
### Python Docstrings
|
||||
|
||||
@@ -86,12 +86,12 @@ we use the `format()` version. The [official Python documentation says](https://
|
||||
|
||||
We use [Flake8](http://flake8.pycqa.org/en/latest/index.html) to check our Python code style. Once you have it installed, you can run it using:
|
||||
```text
|
||||
flake8 --max-line-length 119 bigchaindb/
|
||||
flake8 --max-line-length 119 planetmint/
|
||||
```
|
||||
|
||||
|
||||
## Writing and Running (Python) Tests
|
||||
|
||||
The content of this section was moved to [`bigchaindb/tests/README.md`](https://github.com/bigchaindb/bigchaindb/blob/master/tests/README.md).
|
||||
The content of this section was moved to [`planetmint/tests/README.md`](https://github.com/planetmint/planetmint/blob/master/tests/README.md).
|
||||
|
||||
Note: We automatically run all tests on all pull requests (using Travis CI), so you should definitely run all tests locally before you submit a pull request. See the above-linked README file for instructions.
|
||||
|
||||
@@ -25,7 +25,7 @@ to [regular semantic versioning](http://semver.org/), but there's no hyphen, e.g
|
||||
|
||||
We use `0.9` and `0.9.0` as example version and short-version values below. You should replace those with the correct values for your new version.
|
||||
|
||||
We follow [BEP-1](https://github.com/bigchaindb/BEPs/tree/master/1), which is our variant of C4, the Collective Code Construction Contract, so a release is just a [tagged commit](https://git-scm.com/book/en/v2/Git-Basics-Tagging) on the `master` branch, i.e. a label for a particular Git commit.
|
||||
We follow [BEP-1](https://github.com/planetmint/BEPs/tree/master/1), which is our variant of C4, the Collective Code Construction Contract, so a release is just a [tagged commit](https://git-scm.com/book/en/v2/Git-Basics-Tagging) on the `master` branch, i.e. a label for a particular Git commit.
|
||||
|
||||
The following steps are what we do to release a new version of _BigchainDB Server_. The steps to release the Python Driver are similar but not the same.
|
||||
|
||||
@@ -37,13 +37,13 @@ The following steps are what we do to release a new version of _BigchainDB Serve
|
||||
- Update all Docker image tags in all Kubernetes YAML files (in the `k8s/` directory).
|
||||
For example, in the files:
|
||||
|
||||
- `k8s/bigchaindb/bigchaindb-ss.yaml` and
|
||||
- `k8s/dev-setup/bigchaindb.yaml`
|
||||
- `k8s/planetmint/planetmint-ss.yaml` and
|
||||
- `k8s/dev-setup/planetmint.yaml`
|
||||
|
||||
find the line of the form `image: bigchaindb/bigchaindb:0.8.1` and change the version number to the new version number, e.g. `0.9.0`. (This is the Docker image that Kubernetes should pull from Docker Hub.)
|
||||
find the line of the form `image: planetmint/planetmint:0.8.1` and change the version number to the new version number, e.g. `0.9.0`. (This is the Docker image that Kubernetes should pull from Docker Hub.)
|
||||
Keep in mind that this is a _Docker image tag_ so our naming convention is
|
||||
a bit different; see Note 2 in the **Notes** section above.
|
||||
- In `bigchaindb/version.py`:
|
||||
- In `planetmint/version.py`:
|
||||
- update `__version__` to e.g. `0.9.0` (with no `.dev` on the end)
|
||||
- update `__short_version__` to e.g. `0.9` (with no `.dev` on the end)
|
||||
- In the docs about installing Planetmint (and Tendermint), and in the associated scripts, recommend/install a version of Tendermint that _actually works_ with the soon-to-be-released version of Planetmint. You can find all such references by doing a search for the previously-recommended version number, such as `0.31.5`.
|
||||
@@ -51,7 +51,7 @@ The following steps are what we do to release a new version of _BigchainDB Serve
|
||||
|
||||
2. **Wait for all the tests to pass!**
|
||||
3. Merge the pull request into the `master` branch.
|
||||
4. Go to the [bigchaindb/bigchaindb Releases page on GitHub](https://github.com/bigchaindb/bigchaindb/releases)
|
||||
4. Go to the [planetmint/planetmint Releases page on GitHub](https://github.com/planetmint/planetmint/releases)
|
||||
and click the "Draft a new release" button.
|
||||
5. Fill in the details:
|
||||
- **Tag version:** version number preceded by `v`, e.g. `v0.9.1`
|
||||
@@ -59,9 +59,9 @@ The following steps are what we do to release a new version of _BigchainDB Serve
|
||||
- **Title:** Same as tag version above, e.g `v0.9.1`
|
||||
- **Description:** The body of the changelog entry (Added, Changed, etc.)
|
||||
6. Click "Publish release" to publish the release on GitHub.
|
||||
7. On your local computer, make sure you're on the `master` branch and that it's up-to-date with the `master` branch in the bigchaindb/bigchaindb repository (e.g. `git pull upstream master`). We're going to use that to push a new `bigchaindb` package to PyPI.
|
||||
7. On your local computer, make sure you're on the `master` branch and that it's up-to-date with the `master` branch in the planetmint/planetmint repository (e.g. `git pull upstream master`). We're going to use that to push a new `planetmint` package to PyPI.
|
||||
8. Make sure you have a `~/.pypirc` file containing credentials for PyPI.
|
||||
9. Do `make release` to build and publish the new `bigchaindb` package on PyPI. For this step you need to have `twine` installed. If you get an error like `Makefile:135: recipe for target 'clean-pyc' failed` then try doing
|
||||
9. Do `make release` to build and publish the new `planetmint` package on PyPI. For this step you need to have `twine` installed. If you get an error like `Makefile:135: recipe for target 'clean-pyc' failed` then try doing
|
||||
```text
|
||||
sudo chown -R $(whoami):$(whoami) .
|
||||
```
|
||||
@@ -80,8 +80,8 @@ The following steps are what we do to release a new version of _BigchainDB Serve
|
||||
3. Scroll to the bottom of the page and click "Save".
|
||||
11. Go to [Docker Hub](https://hub.docker.com/) and sign in, then:
|
||||
- Click on "Organizations"
|
||||
- Click on "bigchaindb"
|
||||
- Click on "bigchaindb/bigchaindb"
|
||||
- Click on "planetmint"
|
||||
- Click on "planetmint/planetmint"
|
||||
- Click on "Build Settings"
|
||||
- Find the row where "Docker Tag Name" equals `latest`
|
||||
and change the value of "Name" to the name (Git tag)
|
||||
|
||||
@@ -62,7 +62,7 @@ Set Up Your Local Machine. Here's How.
|
||||
$ virtualenv -p $(which python3.6) NEW_ENV_NAME
|
||||
$ . NEW_ENV_NAME/bin/activate
|
||||
|
||||
Be sure to use Python 3.6.x as the Python version for your virtualenv. The virtualenv creation process will actually get the
|
||||
Be sure to use Python 3.9.x as the Python version for your virtualenv. The virtualenv creation process will actually get the
|
||||
latest ``pip``, ``wheel`` and ``setuptools`` and put them inside the new virtualenv.
|
||||
|
||||
|
||||
|
||||
@@ -300,7 +300,7 @@ full path to the file where error logs should be written.
|
||||
### log.level_console
|
||||
|
||||
The log level used to log to the console. Possible allowed values are the ones
|
||||
defined by [Python](https://docs.python.org/3.6/library/logging.html#levels),
|
||||
defined by [Python](https://docs.python.org/3.9/library/logging.html#levels),
|
||||
but case-insensitive for the sake of convenience:
|
||||
|
||||
```text
|
||||
@@ -310,7 +310,7 @@ but case-insensitive for the sake of convenience:
|
||||
### log.level_logfile
|
||||
|
||||
The log level used to log to the log file. Possible allowed values are the ones
|
||||
defined by [Python](https://docs.python.org/3.6/library/logging.html#levels),
|
||||
defined by [Python](https://docs.python.org/3.9/library/logging.html#levels),
|
||||
but case-insensitive for the sake of convenience:
|
||||
|
||||
```text
|
||||
@@ -323,7 +323,7 @@ The format string for the date/time portion of a message, when logged to the
|
||||
console.
|
||||
|
||||
For more information on how to construct the format string please consult the
|
||||
table under [Python's documentation of time.strftime(format[, t])](https://docs.python.org/3.6/library/time.html#time.strftime).
|
||||
table under [Python's documentation of time.strftime(format[, t])](https://docs.python.org/3.9/library/time.html#time.strftime).
|
||||
|
||||
### log.datefmt_logfile
|
||||
|
||||
@@ -331,7 +331,7 @@ The format string for the date/time portion of a message, when logged to a log
|
||||
file.
|
||||
|
||||
For more information on how to construct the format string please consult the
|
||||
table under [Python's documentation of time.strftime(format[, t])](https://docs.python.org/3.6/library/time.html#time.strftime).
|
||||
table under [Python's documentation of time.strftime(format[, t])](https://docs.python.org/3.9/library/time.html#time.strftime).
|
||||
|
||||
### log.fmt_console
|
||||
|
||||
@@ -339,7 +339,7 @@ A string used to format the log messages when logged to the console.
|
||||
|
||||
For more information on possible formatting options please consult Python's
|
||||
documentation on
|
||||
[LogRecord attributes](https://docs.python.org/3.6/library/logging.html#logrecord-attributes).
|
||||
[LogRecord attributes](https://docs.python.org/3.9/library/logging.html#logrecord-attributes).
|
||||
|
||||
### log.fmt_logfile
|
||||
|
||||
@@ -347,7 +347,7 @@ A string used to format the log messages when logged to a log file.
|
||||
|
||||
For more information on possible formatting options please consult Python's
|
||||
documentation on
|
||||
[LogRecord attributes](https://docs.python.org/3.6/library/logging.html#logrecord-attributes).
|
||||
[LogRecord attributes](https://docs.python.org/3.9/library/logging.html#logrecord-attributes).
|
||||
|
||||
### log.granular_levels
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ $ planetmint --log-level INFO start
|
||||
|
||||
The allowed levels are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`.
|
||||
For an explanation regarding these levels please consult the
|
||||
[Logging Levels](https://docs.python.org/3.6/library/logging.html#levels)
|
||||
[Logging Levels](https://docs.python.org/3.9/library/logging.html#levels)
|
||||
section of Python's documentation.
|
||||
|
||||
For a more fine-grained control over the logging configuration you can use the
|
||||
|
||||
@@ -13,7 +13,7 @@ Code is Apache-2.0 and docs are CC-BY-4.0
|
||||
|
||||
Planetmint Server requires Python 3.5+ and Python 3.5+ [will run on any modern OS](https://docs.python.org/3.5/using/index.html), but we recommend using an LTS version of [Ubuntu Server](https://www.ubuntu.com/server) or a similarly server-grade Linux distribution.
|
||||
|
||||
_Don't use macOS_ (formerly OS X, formerly Mac OS X), because it's not a server-grade operating system. Also, BigchaindB Server uses the Python multiprocessing package and [some functionality in the multiprocessing package doesn't work on Mac OS X](https://docs.python.org/3.6/library/multiprocessing.html#multiprocessing.Queue.qsize).
|
||||
_Don't use macOS_ (formerly OS X, formerly Mac OS X), because it's not a server-grade operating system. Also, Planetmint Server uses the Python multiprocessing package and [some functionality in the multiprocessing package doesn't work on Mac OS X](https://docs.python.org/3.9/library/multiprocessing.html#multiprocessing.Queue.qsize).
|
||||
|
||||
## General Considerations
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ MongoDB and Tendermint.
|
||||
|
||||
## Install Planetmint Server
|
||||
|
||||
Planetmint Server requires **Python 3.6+**, so make sure your system has it.
|
||||
Planetmint Server requires **Python 3.9+**, so make sure your system has it.
|
||||
|
||||
Install the required OS-level packages:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user