Skip to content

Commit df6b4db

Browse files
committed
Add contribution instructions in CONTRIBUTING.md
1 parent 076df9c commit df6b4db

File tree

4 files changed

+46
-9
lines changed

4 files changed

+46
-9
lines changed

CONTRIBUTING.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Contributing to `iocursor`
2+
3+
For bug fixes or new features, please file an issue before submitting a
4+
pull request. If the change isn't trivial, it may be best to wait for
5+
feedback.
6+
7+
## Running tests
8+
9+
Tests are written as usual Python unit tests with the `unittest` module of
10+
the standard library. Running them requires the extension to be built
11+
locally:
12+
13+
```console
14+
$ python setup.py build_ext --debug --inplace
15+
$ python -m unittest discover -vv
16+
```
17+
18+
## Coding guidelines
19+
20+
This project targets Python 3.5 or later.
21+
22+
Python objects should be typed; since it is not supported in C extensions,
23+
you must manually declare types in type stubs (`.pyi` files). In Python
24+
files, you can add type annotations to function signatures (supported in
25+
Python 3.5), but not in variable assignments (supported only from Python 3.6
26+
onward).
27+
28+
### Interfacing with C
29+
30+
When interfacing with C, and in particular with pointers, try to use
31+
debug assertions everywhere you assume the pointer to be non-NULL.

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include COPYING
22
include CHANGELOG.md
3+
include CONTRIBUTING.md
34
include iocursor/cursor.c
45
include iocursor/cursor.h
56
include iocursor/py.typed

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Install directly from PyPI, using [pip](https://pip.pypa.io/):
4242
$ pip install iocursor
4343
```
4444

45+
Pre-built wheels are available on Linux and OSX for all supported Python3
46+
versions. Otherwise, building from source only requires a working C compiler.
47+
4548

4649
## 🧶 Thread-safety
4750

@@ -103,6 +106,10 @@ or ask something. If you are filing in on a bug, please include as much
103106
information as you can about the issue, and try to recreate the same bug
104107
in a simple, easily reproducible situation.
105108

109+
### 🏗️ Contributing
110+
111+
Contributions are more than welcome! See [`CONTRIBUTING.md`](https://github.com/althonos/iocursor/blob/master/CONTRIBUTING.md) for more details.
112+
106113
## ⚖️ License
107114

108115
This library is provided under the [MIT License](https://choosealicense.com/licenses/mit/).

setup.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44

55
import configparser
6+
import glob
67
import os
78
import sys
89

@@ -72,17 +73,14 @@ def build_extension(self, ext):
7273

7374
class clean(_clean):
7475

75-
def run(self):
76-
77-
source_dir = os.path.join(os.path.dirname(__file__), "pyhmmer")
76+
def info(self, message):
77+
self.announce(message, level=2)
7878

79-
patterns = ["*.html"]
79+
def run(self):
80+
source_dir = os.path.join(os.path.dirname(__file__), "iocursor")
8081
if self.all:
81-
patterns.extend(["*.so", "*.c"])
82-
83-
for pattern in patterns:
84-
for file in glob.glob(os.path.join(source_dir, pattern)):
85-
log.info("removing {!r}".format(file))
82+
for file in glob.glob(os.path.join(source_dir, "*.so")):
83+
self.info("removing {!r}".format(file))
8684
os.remove(file)
8785

8886
_clean.run(self)

0 commit comments

Comments
 (0)