Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit cacec01

Browse files
marksibrahimfacebook-github-bot
authored andcommitted
Package CrypTen on PyPI
Summary: CrypTen is now a proper [PyPI package](https://pypi.org/project/crypten/0.1/), making installation one step: `pip install crypten`. * update readme with new installation instructions * add logo raw link so it renders on PyPI * update license and project url in `setup.py` * specific version of `torch` and `torchvision` now specified in `requirements.txt` and automatically installed via pip We can now also track installation statistics via PyPI. Reviewed By: vreis Differential Revision: D19746436 fbshipit-source-id: 7c64fc473265ef80751e01c95f003fffe0427f16
1 parent 4ad37cb commit cacec01

File tree

5 files changed

+25
-22
lines changed

5 files changed

+25
-22
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><img width="70%" src="docs/\_static/img/CrypTen_Identity_Horizontal_Lockup_01_FullColor.png" alt="CrypTen logo" /></p>
1+
<p align="center"><img width="70%" src="https://raw.githubusercontent.com/facebookresearch/CrypTen/master/docs/_static/img/CrypTen_Identity_Horizontal_Lockup_01_FullColor.png" alt="CrypTen logo" /></p>
22

33
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebookresearch/CrypTen/blob/master/LICENSE) [![CircleCI](https://circleci.com/gh/facebookresearch/CrypTen.svg?style=shield)](https://circleci.com/gh/facebookresearch/CrypTen/tree/master) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/facebookresearch/CrypTen/blob/master/CONTRIBUTING.md)
44

@@ -41,19 +41,13 @@ It is currently not production ready and its main use is as a research framework
4141

4242
## Installing CrypTen
4343

44-
CrypTen currently runs on Linux and Mac. It also needs a PyTorch nightly build.
45-
Windows is not supported. We also do not currently support computation on GPUs.
44+
CrypTen currently runs on Linux and Mac with Python >= 3.7.
45+
Windows **is not** supported. We also do not currently support computation on GPUs.
4646

47-
Install Anaconda 2019.07 or later and then do the following:
4847

4948
_For Linux or Mac_
5049
```bash
51-
conda create -n crypten-env python=3.7
52-
conda activate crypten-env
53-
conda install pytorch torchvision -c pytorch
54-
git clone https://github.com/facebookresearch/CrypTen.git
55-
cd CrypTen
56-
pip install -e .
50+
pip install crypten
5751
```
5852

5953
If you want to run the examples in the `examples` directory, you should also do the following

crypten/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# This source code is licensed under the MIT license found in the
66
# LICENSE file in the root directory of this source tree.
77

8+
__version__ = "0.1.0"
9+
810
import crypten.communicator as comm
911
import crypten.mpc # noqa: F401
1012
import crypten.nn # noqa: F401

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
torch==1.4.0
2+
torchvision==0.5.0
13
onnx
24
tensorboard
35
future

setup.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,49 @@
66
# LICENSE file in the root directory of this source tree.
77

88
import os.path
9+
import re
910
import sys
1011

1112
import setuptools
1213

1314

1415
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "crypten"))
1516

16-
# Read description, license and requirements.
17+
# Read description and requirements.
1718
with open("README.md", encoding="utf8") as f:
1819
readme = f.read()
19-
with open("LICENSE") as f:
20-
license = f.read()
2120
with open("requirements.txt") as f:
2221
reqs = f.read()
2322

23+
# get version string from module
24+
init_path = os.path.join(os.path.dirname(__file__), "crypten/__init__.py")
25+
with open(init_path, "r") as f:
26+
version = re.search(r"__version__ = ['\"]([^'\"]*)['\"]", f.read(), re.M).group(1)
27+
2428
# Set key package information.
2529
DISTNAME = "crypten"
26-
DESCRIPTION = "CrypTen: Private and secure machine learning in PyTorch."
30+
DESCRIPTION = "CrypTen: secure machine learning in PyTorch."
2731
LONG_DESCRIPTION = readme
2832
AUTHOR = "Facebook AI Research"
29-
LICENSE = license
33+
LICENSE = "MIT licensed, as found in the LICENSE file"
3034
REQUIREMENTS = (reqs.strip().split("\n"),)
35+
VERSION = version
3136

3237
# Run installer.
3338
if __name__ == "__main__":
39+
if sys.version_info < (3, 7):
40+
sys.exit("Sorry, Python >=3.7 is required for CrypTen.")
41+
3442
setuptools.setup(
3543
name=DISTNAME,
3644
install_requires=REQUIREMENTS,
3745
packages=setuptools.find_packages(),
3846
dependency_links=[],
39-
version="0.1",
47+
version=VERSION,
4048
description=DESCRIPTION,
4149
long_description=LONG_DESCRIPTION,
50+
long_description_content_type="text/markdown",
51+
url="https://github.com/facebookresearch/CrypTen",
4252
author=AUTHOR,
4353
license=LICENSE,
4454
setup_requires=["pytest-runner"],

website/pages/en/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,7 @@ class Index extends React.Component {
130130
{
131131
content: 'Please see the '+
132132
'[CrypTen Docs](https://github.com/facebookresearch/crypten#installing-crypten).'+
133-
'\n```bash\n\nconda create -n crypten python=3.7\t\n' +
134-
'conda activate crypten\n' +
135-
'conda install pytorch torchvision -c pytorch\n' +
136-
'# clone\n' +
137-
'git clone https://github.com/facebookresearch/CrypTen.git\n' +
138-
'cd CrypTen; pip install -e .\n\n\n```',
133+
'\n```bash\n\n pip install crypten\n```',
139134
title: 'Installation Script',
140135
},
141136
{

0 commit comments

Comments
 (0)