Skip to content

Commit 302df62

Browse files
authored
Merge pull request #5 from Richardk2n/enforece-uploadability
assure the upload will work
2 parents ac99feb + 6c44c3b commit 302df62

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

.github/workflows/python-package.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [ master ]
1111

1212
jobs:
13-
build:
13+
testCode:
1414

1515
runs-on: ubuntu-latest
1616
strategy:
@@ -41,3 +41,26 @@ jobs:
4141
- name: Test with pytest
4242
run: |
4343
pytest
44+
45+
testUploadability:
46+
47+
runs-on: ubuntu-latest
48+
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Set up Python
52+
uses: actions/setup-python@v2
53+
with:
54+
python-version: '3.x'
55+
- name: Install dependencies
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install setuptools wheel twine
59+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
60+
- name: Test with rstcheck
61+
run: |
62+
rstcheck README.rst
63+
- name: Build and check
64+
run: |
65+
python setup.py sdist bdist_wheel
66+
twine check dist/*

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/psf/black
5-
rev: 21.5b1
5+
rev: 21.6b0
66
hooks:
77
- id: black
8+
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
9+
rev: v1.0.1
10+
hooks:
11+
- id: rst-linter

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Install development dependencies with (you might want to create a virtualenv fir
6565

6666
The project is formatted with `black`_. You can either configure your IDE to automatically format code with it, run it manually (``black .``) or rely on pre-commit (see below) to format files on git commit.
6767

68+
The project uses two rst tests in order to assure uploadability to pipy: `rst-linter`_ as a pre-commit hook and `rstcheck`_ in a GitHub workflow. This does not catch all errors.
69+
6870
This project uses `pre-commit`_ to enforce code-quality. After cloning the repository install the pre-commit hooks with:
6971

7072
::
@@ -74,5 +76,7 @@ This project uses `pre-commit`_ to enforce code-quality. After cloning the repos
7476
After that pre-commit will run `all defined hooks`_ on every ``git commit`` and keep you from committing if there are any errors.
7577

7678
.. _black: https://github.com/psf/black
79+
.. _rst-linter: https://github.com/Lucas-C/pre-commit-hooks-markup
80+
.. _rstcheck: https://github.com/myint/rstcheck
7781
.. _pre-commit: https://pre-commit.com/
7882
.. _all defined hooks: .pre-commit-config.yaml

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ python-lsp-server
22
mypy
33
black
44
pre-commit
5+
rstcheck

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
from mypy_ls import _version
44

55
if __name__ == "__main__":
6-
setup(version=_version.__version__)
6+
setup(version=_version.__version__, long_description_content_type="text/x-rst")

0 commit comments

Comments
 (0)