Skip to content

Commit

Permalink
Release on Pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
elarivie committed Mar 31, 2018
1 parent 95f4613 commit ce73aa6
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ end_of_line = crlf

[*.md]
trim_trailing_whitespace = false
indent_style = tab

[*.py]
indent_style = tab
Expand Down
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# Change Log
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased] - ?.?.? 20??-??-??
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [Released] - 1.0.0 2018-03-30
**Note:** Version number was left at 1.0.0 since it is the first release on Pypi.

### Changed
- The license GPLV3 -> MIT
- Adjusted the project structure for PyPI release
- make pep8 happy
- Rename module:
- RWLock ➡ rwlock
- Rename methods:
- genRlock ➡ gen_rlock
- genWlock ➡ gen_wlock
- make pep257 happy
- Add lint steps in BUILDME
- Setup CI with TravisCI
- Publish as a python package on pypi: [readerwriterlock](https://pypi.python.org/pypi/readerwriterlock)

## [Released] - 1.0.0 2015-07-08

### Added
- RWLockRead
- RWLockWrite
Expand Down
28 changes: 25 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,48 @@ Reader Writer Lock

**A python implementation of the three Reader-Writer problems.**

[![Code size in bytes](https://img.shields.io/github/languages/code-size/elarivie/pyReaderWriterLock.svg)][pyReaderWriterLock_repo]
[![Build Status](https://travis-ci.org/elarivie/pyReaderWriterLock.svg?branch=master)](https://travis-ci.org/elarivie/pyReaderWriterLock)
[![BugTracker](https://img.shields.io/github/issues/elarivie/pyReaderWriterLock.svg)][pyReaderWriterLock_BugTracker]
![License](https://img.shields.io/pypi/l/readerwriterlock.svg)

[![Python Version](https://img.shields.io/pypi/pyversions/readerwriterlock.svg)][python]
[![Pypi Version](https://img.shields.io/pypi/v/readerwriterlock.svg)][pyReaderWriterLock_Pypi]
[![Pypi Status](https://img.shields.io/pypi/status/readerwriterlock.svg)][pyReaderWriterLock_Pypi]

Not only does it implement the reader-writer problems, it is also compliant with the python lock interface which includes support for timeouts.

For reading about the theory behind the reader-writer problems refer to [Wikipedia](https://wikipedia.org/wiki/Readers–writers_problem).

# Installation

Install the python package [readerwriterlock](https://pypi.python.org/pypi/readerwriterlock)

python3 -m pip install readerwriterlock


# Usage

Initialize a new lock base on your access priority need which is going to be use by the threads:

**Reader priority** (*aka First readers-writers problem*)

```python
import rwlock
from readerwriterlock import rwlock
a = rwlock.RWLockRead()
```

**Writer priority** (*aka Second readers-writers problem*)

```python
import rwlock
from readerwriterlock import rwlock
a = rwlock.RWLockWrite()
```

**Fair priority** (*aka Third readers-writers problem*)

```python
import rwlock
from readerwriterlock import rwlock
a = rwlock.RWLockFair()
```

Expand Down Expand Up @@ -73,3 +89,9 @@ Contact
----
* Project: [GitHub](https://github.com/elarivie/pyReaderWriterLock)
* Éric Larivière <[email protected]>

[python]: https://www.python.org
[pyReaderWriterLock_repo]: https://github.com/elarivie/pyReaderWriterLock
[pyReaderWriterLock_package]: https://atom.io/packages/pyReaderWriterLock
[pyReaderWriterLock_BugTracker]: https://github.com/elarivie/pyReaderWriterLock/issues
[pyReaderWriterLock_Pypi]: https://github.com/elarivie/pyReaderWriterLock/issues
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def read(fname: str) -> str:
with open(os.path.join(os.path.dirname(__file__), fname), mode="r", encoding="utf-8") as f:
return f.read().strip()


setup(
metadata_version=2.1,
name=read("NAME"),
Expand All @@ -23,9 +24,9 @@ def read(fname: str) -> str:
keywords=['rwlock', 'read-write lock', 'lock', "priority", "reader", "writer", "fair", "read", "write"],
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',

# Indicate who your project is intended for
Expand All @@ -40,7 +41,7 @@ def read(fname: str) -> str:
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6'
],
project_urls= {
project_urls={
'Source': 'https://github.com/elarivie/pyReaderWriterLock',
'Tracker': 'https://github.com/elarivie/pyReaderWriterLock/issues'
},
Expand Down

0 comments on commit ce73aa6

Please sign in to comment.