-
-
Notifications
You must be signed in to change notification settings - Fork 142
Added pypi workflow #136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added pypi workflow #136
Changes from all commits
c02ba86
3d5279c
85b7d8e
ede93e3
81afba1
9cc3aea
0e83314
99a3e43
c161f52
91fa710
c53abe6
ea739f6
c85e916
af53a2b
9e5bc6e
dc6458f
fb62fa8
b7e6689
fd20f54
adf3a23
f4a1d87
4fdf3ca
27cd53f
c8dee93
74037b2
c5dd91c
ed20a7e
4f9268e
8d812d4
2ddbf84
6b92503
2fe030d
6ff7f7c
c1b7b3f
b59f49b
1ce9104
c66ea8d
fe8be68
103a96c
6b71f9c
1261bae
ac15750
2676b8d
b4cc457
9130d0a
7afec62
ca7a656
c93df51
31cd91e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: Linux Package PyPI deploy | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
|
|
||
| jobs: | ||
| deploy: | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| python-version: [3.5, 3.6, 3.7,3.8] | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Set up submodules | ||
| run: | | ||
| bash ./ext_source_setup.sh | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install pre-requisites | ||
| run: | | ||
| sudo apt-get update | ||
| # checking for g++ | ||
| dpkg -s g++ &> /dev/null | ||
| if [ $? -eq 0 ]; then | ||
| echo "g++ is installed, skipping..." | ||
| else | ||
| echo "Installing g++" | ||
| sudo apt-get install g++ | ||
| fi | ||
| echo "Installing Bazel dependencies" | ||
| sudo apt-get install pkg-config zip zlib1g-dev unzip | ||
| echo "Donwloading Bazel 2.1.0" | ||
| wget https://github.com/bazelbuild/bazel/releases/download/2.1.0/bazel-2.1.0-installer-linux-x86_64.sh | ||
|
|
||
| chmod +x bazel-2.1.0-installer-linux-x86_64.sh | ||
| ./bazel-2.1.0-installer-linux-x86_64.sh --user | ||
| export PATH="$PATH:$HOME/bin" | ||
| - name: Build pydp lib | ||
| run: | | ||
| bash ./build_PyDP.sh | ||
|
|
||
| - name: Install python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r ./requirements_dev.txt | ||
|
|
||
| - name: Build wheel | ||
| run: | | ||
| python setup.py bdist_wheel | ||
|
|
||
| - name: Renaming wheel | ||
| run: | | ||
| find . -name '*linux*.whl' -type f -exec bash -c 'mv "$1" "${1/linux/manylinux1}"' -- {} \; | ||
|
Comment on lines
+58
to
+60
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't agree that renaming is the way to go here, you should be using the auditwheel package for compliance, it might break on some systems.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The package is manylinux1 compliant. So adding it here.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi there , @chinmayshah99 let’s open an issue as it is a good practise to normally use auditwheel to publish on PyPi. It will enable to keep track or the changes.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, let's do this. Are you creating an issue? |
||
|
|
||
| - name: Publishing the wheel | ||
| env: | ||
| TWINE_USERNAME: "__token__" | ||
| TWINE_PASSWORD: ${{ secrets.TOKEN }} | ||
| run: | | ||
| twine upload --skip-existing dist/*.whl | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| Introduction | ||
| ============ | ||
|
|
||
| PyDP is a Python wrapper for Google’s `Differential Privacy`_ project. | ||
| The library provides a set of ε-differentially private algorithms, which | ||
| can be used to produce aggregate statistics over numeric data sets | ||
| containing private or sensitive information. | ||
|
|
||
| PyDP is part of the OpenMined community, come join the movement on | ||
| `Slack`_. | ||
|
|
||
| Instructions | ||
| ============ | ||
|
|
||
| If you’d like to contribute to this project please read these | ||
| `guidelines`_. | ||
|
|
||
| Usage | ||
| ----- | ||
|
|
||
| As part of the 0.1.1 dev release, we have managed to port the Private | ||
| Mean function (Bounded Mean). Other functions will be released in | ||
| further release. | ||
|
|
||
| To install the package: ``pip install python-dp`` | ||
|
|
||
| :: | ||
|
|
||
| import pydp as dp # imports the DP library | ||
|
|
||
| # To calculate the Bounded Mean | ||
| # epsilon is a number between 0 and 1 denoting privacy threshold | ||
| # It measures the acceptable loss of privacy (with 0 meaning no loss is acceptable) | ||
| # If both the lower and upper bounds are specified, | ||
| # x = dp.BoundedMean(epsilon: double, lower: int, upper: int) | ||
| x = dp.BoundedMean(0.6, 1, 10) | ||
|
|
||
| # If lower and upper bounds are not specified, | ||
| # DP library automatically calculates these bounds | ||
| # x = dp.BoundedMean(epsilon: double) | ||
| x = dp.BoundedMean(0.6) | ||
|
|
||
| # To get the result | ||
| # Currently supported data types are integer and float. Future versions will support additional data types | ||
| # Refer to examples/carrots.py for an introduction | ||
| x.result(input_data: list) | ||
|
|
||
| Known issue: If the privacy budget (epsilon is too less), we get a | ||
| StatusOR error in the command line. While this needs to be raised as an | ||
| error, right now, it’s just displayed as an error in logs. | ||
|
|
||
| .. _Differential Privacy: https://github.com/google/differential-privacy | ||
| .. _Slack: http://slack.openmined.org/ | ||
| .. _guidelines: https://github.com/OpenMined/PyDP/blob/master/contributing.md |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ tox==3.5.2 | |
| coverage==4.5.1 | ||
| pytest | ||
| pycodestyle | ||
| twine | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you require a specific version of bazel? Bazel 3.0 is installed on Ubuntu 18.06
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have tested with this bazel version(2.1). Any upgrade in bazel versions needs to be tested