Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Kulynych committed Sep 23, 2018
1 parent 5dd3f52 commit 94e1ac9
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 45 deletions.
44 changes: 44 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
============
Contributing
============

Dev setup
=========

Install dev packages
--------------------

Specify the ``[dev]`` option to install the development packages:

.. code-block:: bash
pip install -e ".[dev]"
Building docs
-------------

Generate the docs:

.. code-block:: bash
cd docs
make html
You can then check out the generated HTML:

.. code-block:: bash
cd docs/build/html
python3 -m http.server
Formatting code
---------------

mia's code is formatted using `black <https://github.com/ambv/black>`_. Run the formatter as
follows:

.. code-block:: bash
make format
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

.PHONY: format
format:
black mia tests examples
black setup.py mia tests examples
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ more in the paper by `Shokri et al. <https://arxiv.org/abs/1610.05820>`_

This library:

* Implements the original shadow model attack by `Shokri et al. <https://arxiv.org/abs/1610.05820>`_
* Implements the original shadow model `attack <https://arxiv.org/abs/1610.05820>`_
* Is customizable, can use any scikit learn's ``Estimator``-like object as a shadow or attack model
* Is tested with Keras and PyTorch

Expand Down
1 change: 1 addition & 0 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.. include:: ../../CONTRIBUTING.rst
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ A library for running membership inference attacks (MIA) against machine learnin
quickstart
usage
api
contributing

Indices and tables
==================
Expand Down
66 changes: 23 additions & 43 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,22 @@
from setuptools import setup


INSTALL_REQUIRES = [
'numpy',
'scipy',
'scikit-learn',
'torch',
'tqdm',
]
INSTALL_REQUIRES = ["numpy", "scipy", "scikit-learn", "torch", "tqdm"]

SETUP_REQUIRES = [
'pytest-runner',
]
SETUP_REQUIRES = ["pytest-runner"]

TEST_REQUIRES = [
'pytest',
'pytest-lazy-fixture',
'tensorflow',
'skorch',
'keras',
]
TEST_REQUIRES = ["pytest", "pytest-lazy-fixture", "tensorflow", "skorch", "keras"]

DEV_REQUIRES = TEST_REQUIRES + [
'sphinx',
'sphinx_rtd_theme'
]
DEV_REQUIRES = TEST_REQUIRES + ["sphinx", "sphinx_rtd_theme", "black"]


here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst')) as f:
long_description = f.read()
with open(os.path.join(here, "README.rst")) as f:
long_description = f.read()


with open(os.path.join(here, 'mia/__init__.py')) as f:
matches = re.findall(r'(__.+__) = \"(.*)\"', f.read())
with open(os.path.join(here, "mia/__init__.py")) as f:
matches = re.findall(r"(__.+__) = \"(.*)\"", f.read())
for var_name, var_value in matches:
globals()[var_name] = var_value

Expand All @@ -49,29 +32,26 @@
long_description=long_description,
author=__author__,
author_email=__email__,
packages=['mia'],
packages=["mia"],
license=__license__,
url=__url__,
install_requires=INSTALL_REQUIRES,
setup_requires=SETUP_REQUIRES,
tests_require=TEST_REQUIRES,
extras_require={
'dev': DEV_REQUIRES,
'test': TEST_REQUIRES
},
extras_require={"dev": DEV_REQUIRES, "test": TEST_REQUIRES},
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: MIT License',
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: MIT License",
],
)

0 comments on commit 94e1ac9

Please sign in to comment.