Skip to content
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 support for release on PyPI #166

Merged
merged 1 commit into from
Jan 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/publish.yml
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ precommit: lint test format clean
.PHONY: dev
dev:
pip install -r requirements.dev.txt

.PHONY: dist
dist:
python setup.py bdist_wheel
2 changes: 2 additions & 0 deletions pipeline_dp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
from pipeline_dp.pipeline_backend import BeamBackend
from pipeline_dp.pipeline_backend import SparkRDDBackend
from pipeline_dp import accumulator

__version__ = '0.0.1rc0'
33 changes: 19 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
[tool.poetry]
name = "pipelinedp"
version = "0.1.0"
name = "pipeline-dp"
version = "0.0.1rc0"
description = ""
authors = ["Chinmay Shah <chinmayshah3899@gmail.com>", "Vadym Doroshenko <dvadym@google.com>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.6"
apache-beam = "^2.29.0"
pyspark = "^3.1.1"
absl-py = "^0.12.0"
dataclasses = {version = "^0.8", python = "~3.6"}
numpy = "<1.21"
scipy = "^1.5"
yapf = "^0.31.0"
python = "^3.8, < 3.11"
python-dp = "^1.1.1"
pyspark = "^3.2.0"
absl-py = "^1.0.0"
numpy = "^1.20.1"
apache-beam = "^2.35.0"
scipy = "^1.7.3"
dp-accounting = "^0.0.2"

[tool.poetry.dev-dependencies]

[tool.yapf]
based_on_style = "google"
indent_width = 4
[tool.poetry.dev-dependencies]
yapf = "^0.32.0"
twine = "^3.7.1"
pytest = "^6.2.5"
pytest-timeout = "^2.1.0"
pylint = "2.12.0"
bumpversion = "==0.5.3"
wheel = "^0.37.1"
setuptools = "^60.5.0"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
22 changes: 22 additions & 0 deletions setup.cfg
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
44 changes: 44 additions & 0 deletions setup.py
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)