-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from chinmayshah99/feature/pypi-support
added support for release on PyPI
- Loading branch information
Showing
6 changed files
with
186 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: Publish PipelineDP | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 3 | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: [3.8] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Setup msbuild Windows | ||
if: runner.os == 'Windows' | ||
uses: microsoft/setup-msbuild@v1.0.2 | ||
|
||
- name: Fix Paths Windows | ||
# Make sure that tar.exe from Git is used not from Windows | ||
if: runner.os == 'Windows' | ||
run: | | ||
@("C:\Program Files\Git\usr\bin") + (Get-Content $env:GITHUB_PATH) | Set-Content $env:GITHUB_PATH -Encoding utf8 | ||
- name: Build Pipeline DP Windows | ||
if: runner.os == 'Windows' | ||
timeout-minutes: 20 | ||
run: | | ||
$PYTHONHOME=$(python -c 'import sys; print(sys.executable);').replace('\', '/') | ||
$PYTHONPATH=$(python -c "import sys; print([x for x in sys.path if 'site-packages' in x][0]);").replace('\', '/') | ||
echo "PYTHONHOME=$PYTHONHOME" | ||
echo "PYTHONPATH=$PYTHONPATH" | ||
echo "Running: ${{ matrix.os }}" | ||
- name: Upgrade pip | ||
run: | | ||
pip install --upgrade --user pip | ||
- name: Install Poetry | ||
run: | | ||
pip install poetry | ||
- name: Get poetry cache dir | ||
id: poetry-cache | ||
run: | | ||
echo "::set-output name=dir::$(poetry config cache-dir)" | ||
- name: poetry cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.poetry-cache.outputs.dir }} | ||
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip-py${{ matrix.python-version }}- | ||
- name: Install dependencies | ||
run: | | ||
poetry install | ||
- name: Build PipelineDP Linux | ||
run: | | ||
poetry run python setup.py bdist_wheel | ||
- name: Install Wheel Unix | ||
if: runner.os != 'Windows' | ||
run: | | ||
pip install `find -L ./ -name "*.whl"` | ||
- name: Import Package | ||
run: | | ||
python -c "import pipeline_dp; print(pipeline_dp.__version__)" | ||
- name: Check Wheel Unix | ||
if: runner.os != 'Windows' | ||
run: | | ||
poetry run twine check `find -L ./ -name "*.whl"` | ||
- name: Publishing the wheel | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TOKEN }} | ||
run: | | ||
poetry run twine upload --skip-existing dist/*.whl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[bumpversion] | ||
current_version = 0.0.1rc0 | ||
commit = True | ||
tag = True | ||
|
||
[bumpversion:file:setup.py] | ||
search = version='{current_version}' | ||
replace = version='{new_version}' | ||
|
||
[bumpversion:file:pyproject.toml] | ||
search = version='{current_version}' | ||
replace = version='{new_version}' | ||
|
||
[bumpversion:file:pipeline_dp/__init__.py] | ||
search = __version__ = '{current_version}' | ||
replace = __version__ = '{new_version}' | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
|
||
[flake8] | ||
exclude = docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# -*- coding: utf-8 -*- | ||
from setuptools import setup | ||
import os | ||
|
||
packages = \ | ||
['pipeline_dp'] | ||
|
||
package_data = \ | ||
{'': ['*']} | ||
|
||
install_requires = \ | ||
['absl-py>=1.0.0,<2.0.0', | ||
'apache-beam>=2.35.0,<3.0.0', | ||
'dp-accounting>=0.0.2,<0.0.3', | ||
'numpy>=1.20.1,<2.0.0', | ||
'pyspark>=3.2.0,<4.0.0', | ||
'python-dp>=1.1.1,<2.0.0', | ||
'scipy>=1.7.3,<2.0.0'] | ||
|
||
|
||
def read(fname): | ||
with open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8") as fp: | ||
return fp.read() | ||
|
||
setup_kwargs = { | ||
'name': 'pipeline-dp', | ||
'version': '0.0.1rc0', | ||
'description': 'Framework for applying differential privacy to large datasets using batch processing systems', | ||
'author': 'Chinmay Shah', | ||
'author_email': 'chinmayshah3899@gmail.com', | ||
'maintainer': 'Vadym Doroshenko', | ||
'maintainer_email': 'dvadym@google.com', | ||
'url': 'https://github.com/OpenMined/PipelineDP/', | ||
'packages': packages, | ||
'package_data': package_data, | ||
'install_requires': install_requires, | ||
'python_requires': '>=3.8,<3.11', | ||
'long_description': read("README.md"), | ||
'long_description_content_type': 'text/markdown', | ||
'license': "Apache-2.0", | ||
} | ||
|
||
|
||
setup(**setup_kwargs) |