Skip to content

Commit

Permalink
Tweak release steps, linting improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
GhostofGoes committed Sep 4, 2019
1 parent f3be521 commit 03bd611
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 23 deletions.
8 changes: 5 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include LICENSE README.md CHANGELOG.md CONTRIBUTING.md NOTICE
include docs/adles.1 tox.ini
include CHANGELOG.md CONTRIBUTING.md LICENSE NOTICE README.md setup.py tox.ini
include docs/adles.1

graft adles
graft docs
Expand All @@ -9,7 +9,9 @@ graft specifications

prune documentation
prune misc
prune .github
prune scripts

exclude .editorconfig
exclude .editorconfig .travis.yml

global-exclude *.py[cdo] __pycache__ *.so *.pyd .DS_Store
2 changes: 1 addition & 1 deletion adles/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .__about__ import __version__
from .__about__ import __version__ # noqa: F401
20 changes: 12 additions & 8 deletions documentation/releasing.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
If `twine` isn't installed, get it: `python -m pip install --user -U twine`
If you're not in a virtual environment, make one and activate it:
```bash
python -m venv ./venv
source ./venv/bin/activate
```

If `twine` isn't installed, get it: `pip install -U twine`

Release steps:
1. Increment version number in `adles/__about__.py`
2. Update CHANGELOG header from UNRELEASED to the version and add the date
3. Run static analysis checks (`tox -e check`)
4. Run the test suite on the main supported platforms (`tox`)
a) Windows
b) Ubuntu
c) CentOS
d) OSX
3. Run static analysis and lint checks: `tox -e check`
4. Run the test suite: `tox`
5. Ensure a pip install from source works on the main platforms:
```bash
pip install https://github.com/ghostofgoes/adles/archive/master.tar.gz
```
6. Clean the environment: `bash ./scripts/clean.sh`
6. Clean the environment: `bash scripts/clean.sh`
7. Build the wheels
```bash
python setup.py sdist bdist_wheel --universal
Expand All @@ -29,4 +32,5 @@ python setup.py --command-packages=stdeb.command bdist_deb
a) The relevant section of the CHANGELOG in the body
b) The source and binary wheels
c) The .deb package
d) The documentation as a PDF and Man page (if it's working)
11. Announce the release in the normal places
17 changes: 17 additions & 0 deletions scripts/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

find . -name '*.pyc' -delete
find . -name '*.pyo' -delete
find . -name '__pycache__' -delete
find . -name '*~' -delete

rm -rf build/
rm -rf dist/
rm -rf *.egg
rm -rf *.egg-info

rm -rf .tox/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf htmlcov
rm -f .coverage.coverage
8 changes: 4 additions & 4 deletions test/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ def test_pad():


def test_split_path():
from adles.utils import split_path

# from adles.utils import split_path
# TODO: fix case-sensitivity on Windows!
# assert split_path('/path/To/A/file') == (['path', 'To', 'A'], 'file')
# TODO: fix
# assert split_path('') == ([''], '')
# TODO: fix
# assert split_path('/') == (['', ''], '')
pass


def test_get_vlan():
from adles.utils import get_vlan

# from adles.utils import get_vlan
# todo: fix "'>=' not supported between instances of 'generator' and 'int"
# assert get_vlan() >= 2000
# assert get_vlan() <= 4096
pass


def test_read_json():
Expand Down
17 changes: 10 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ description = "Run code quality, static analysis, and spelling checks"
skip_install = true
setenv = PIP_DISABLE_VERSION_CHECK = 1
deps =
; TODO: put linting deps in a requirements file
check-manifest
codespell
; codespell
flake8
flake8-bugbear
flake8-import-order
Expand All @@ -32,29 +33,31 @@ deps =
flake8-debugger
pep8-naming
flake8-string-format
; TODO: enable type checking
; NOTE: the released version of flake8-mypy is buggy on Windows (17.8.0)
; flake8-mypy;python_version>='3.5'
# https://github.com/ambv/flake8-mypy/archive/master.tar.gz
; https://github.com/ambv/flake8-mypy/archive/master.tar.gz
bandit>=1.6.0
commands =
python setup.py check --strict --metadata
check-manifest {toxinidir}
# codespell --check-filenames --skip="*.ico,*.png,*.jpg,*.vsdx,*.PNG,*.out,build,dist,*.pyc,*.class,*.git,*.vagrant,*.tox,*.egg-info,*.idea,*.vscode,_build,.doctrees,htmlcov,.venv"
flake8 adles tests setup.py
; TODO: better alternative to codespell (more customization)
; codespell --check-filenames --skip="*.ico,*.png,*.jpg,*.vsdx,*.PNG,*.out,build,dist,*.pyc,*.class,*.git,*.vagrant,*.tox,*.egg-info,*.idea,*.vscode,_build,.doctrees,htmlcov,.venv"
flake8 adles test setup.py
bandit --quiet --recursive --skip B322 adles setup.py

[flake8]
max-line-length = 99
application-import-names = adles
exclude = .github, .vagrant, docs, packaging, samples, scripts, *.egg-info, __pycache__, .git, .tox, .venv
ignore = E203, W503, E401, F401, E226
exclude = .github, .vagrant, documentation, docs, examples, misc, scripts, specifications, *.egg-info, __pycache__, .git, .tox, .venv
; ignore = E203, W503, E401, F401, E226
import-order-style = pycharm
show-source = True
max-complexity = 28

[pytest]
testpaths = test
norecursedirs = .github adles samples scripts .git .tox .vagrant .idea .vscode dist build *.egg .* .venv
norecursedirs = .github adles documentation examples misc scripts specifications .git .tox .vagrant .idea .vscode dist build *.egg .* .venv
addopts =
--tb=short
filterwarnings =
Expand Down

0 comments on commit 03bd611

Please sign in to comment.