Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fametrano committed Jan 1, 2023
1 parent 010b031 commit 12e59cc
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-test_on_py-dev.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
# 2023-01-01 windows-latest does crash
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
12 changes: 9 additions & 3 deletions CONTRIBUTING.md
Expand Up @@ -28,15 +28,21 @@ Here are some resources to help you get started with open source contributions:
Development tools are required to develop and test btclib;
they can be installed with:

python -m pip install --upgrade -r requirements-dev.txt
```shell
python -m pip install --upgrade -r requirements-dev.txt
```

Developers might also consider installing btclib in editable way:

python -m pip install --upgrade -e ./
```shell
python -m pip install --upgrade -e ./
```

Finally, additional packages are needed to build the documentation:

python -m pip install --upgrade -r docs/requirements.txt
```shell
python -m pip install --upgrade -r docs/requirements.txt
```

As an annotated python3 project, btclib is very strict on code formatting
([isort](https://pycqa.github.io/isort/),
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Expand Up @@ -5,6 +5,7 @@ include *.yml
include *.yaml
include .flake8
include tox.ini
include *.json
include pyproject.toml

exclude Gemfile
Expand Down
32 changes: 20 additions & 12 deletions README.md
Expand Up @@ -90,30 +90,38 @@ Included features are:

To install (and/or upgrade) btclib:

python -m pip install --upgrade btclib
```shell
python -m pip install --upgrade btclib
```

You might want to install btclib into a
python virtual environment; e.g. from the root folder:

Bash shell

python -m venv venv_btclib
source ./venv_btclib/bin/activate
python -m pip install --upgrade btclib
```shell
python -m venv venv_btclib
source ./venv_btclib/bin/activate
python -m pip install --upgrade btclib
```

Windows CMD or PowerShell:

python -m venv venv_btclib
.\venv_btclib\Scripts\activate
python -m pip install --upgrade btclib
```shell
python -m venv venv_btclib
.\venv_btclib\Scripts\activate
python -m pip install --upgrade btclib
```

Windows Git bash shell:

python -m venv venv_btclib
cd ./venv_btclib/Scripts
. activate
cd ../..
python -m pip install --upgrade btclib
```shell
python -m venv venv_btclib
cd ./venv_btclib/Scripts
. activate
cd ../..
python -m pip install --upgrade btclib
```

See [CONTRIBUTING](./CONTRIBUTING.md) if you are interested
in btclib develoment.
Expand Down
10 changes: 7 additions & 3 deletions RELEASE.md
Expand Up @@ -22,12 +22,16 @@

1. Build the package distribution files:

rm -r btclib.egg-info/ build/ dist/
python setup.py sdist bdist_wheel
```shell
rm -r btclib.egg-info/ build/ dist/
python setup.py sdist bdist_wheel
```

1. Push the package files to PyPi:

twine upload dist/*
```shell
twine upload dist/*
```

1. Create a new release on GitHub:

Expand Down
30 changes: 20 additions & 10 deletions tests/README.md
Expand Up @@ -2,7 +2,9 @@

## Install required packages

python -m pip install -r requirements-dev.txt
```shell
python -m pip install -r requirements-dev.txt
```

Consider installing the required packages in a dedicated virtual environment.

Expand All @@ -14,28 +16,36 @@ this can be changed in setup.cfg

The ultimate comprehensive way of running the tests is to use tox:

tox
```shell
tox
```

If you want to contribute to btclib, please ensure that tox succeeds.

Alternatively, one can run pytest with coverage

pytest --cov-report term-missing:skip-covered --cov=btclib
```shell
pytest --cov-report term-missing:skip-covered --cov=btclib
```

Coverage results can also be reported as html at htmlcov/index.html:

coverage html
```shell
coverage html
```

Finally, the fastest test execution can be accomplished running pytest only

pytest
```shell
pytest
```

## Profiling

Profiling can be obtained with:

python -m cProfile -s time setup.py test

python -m cProfile -s cumtime setup.py test

python -m cProfile -o btclib.prof setup.py test
```shell
python -m cProfile -s time setup.py test
python -m cProfile -s cumtime setup.py test
python -m cProfile -o btclib.prof setup.py test
```

0 comments on commit 12e59cc

Please sign in to comment.