Skip to content

Commit

Permalink
Added pip extras
Browse files Browse the repository at this point in the history
  • Loading branch information
lowjiajin committed Jul 14, 2020
1 parent 7886160 commit 4bafee2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,21 @@ As such, Snowfall returns unique GUIDs for as long as:
- *Schema group:* A grouping of generators that always produce globally unique IDs.

### Installation
A complete installation of Snowfall with all [`generator_syncers`](#enforcing-unique-generator_ids) and their dependencies.
A minimal installation of Snowfall. This supports both the `SimpleSyncer`, and the `DatabaseSyncer` when used with SQLite.
```
pip install snowfall
```

#### DBMS-specific dependencies
However, because the `DatabaseSyncer` uses SQLAlchemy to connect to the database, there are optional dependencies depending on the DBMS used. For instance, MySQL requires the `MySQL-python` package, while PostgreSQL requires `psycopg2`. More information can be found in the [SQLAlchemy docs](https://docs.sqlalchemy.org/en/latest/core/engines.html).

For convenience, we have included the following pip extras:
```
pip install snowfall[postgres]
pip install snowfall[mysql]
pip install snowfall[oracle]
```

### Quickstart
To start generating IDs, simply create a schema group and start a `Snowfall`.
```
Expand Down
9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name="snowfall",
version="1.0.3",
version="1.0.4",
description="Bigint-based distributed GUID generator",
long_description=(HERE / "README.md").read_text(),
long_description_content_type="text/markdown",
Expand All @@ -28,4 +28,9 @@
"create_db_schema_group=src.generator_syncers.database_syncers:create_schema_group",
]
},
)
extras_require={
"postgres": ["psycopg2-binary==2.8.5"],
"mysql": ["MySQL-python==1.2.5"],
"oracle": ["cx-Oracle==8.0.0"]
}
)

0 comments on commit 4bafee2

Please sign in to comment.