-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push ptf package to PyPI in CI (#184)
We push every time the main branch is updated and every time a release tag is created. Signed-off-by: Antonin Bas <abas@vmware.com>
- Loading branch information
1 parent
9775e55
commit ff79b8c
Showing
13 changed files
with
109 additions
and
66 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
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,40 @@ | ||
name: Publish releases to Pypi | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
publish-to-pypi: | ||
name: Publish a Python distribution to PyPI | ||
if: ${{ github.repository == 'p4lang/ptf' }} | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
. | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip_existing: true |
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 |
---|---|---|
|
@@ -6,3 +6,4 @@ profiles/*.pyc | |
dist | ||
build | ||
*.egg-info | ||
.eggs |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,8 @@ | ||
#!/bin/sh | ||
set -e | ||
git clone https://github.com/nanomsg/nnpy.git | ||
cd nnpy | ||
sudo python3 -m pip install cffi | ||
sudo python3 -m pip install --upgrade cffi | ||
sudo python3 -m pip install . | ||
cd .. |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools", | ||
"setuptools_scm[toml]", | ||
"setuptools_scm_git_archive", | ||
"wheel", | ||
] | ||
build-backend = 'setuptools.build_meta' | ||
|
||
[tool.setuptools_scm] | ||
root = "./" | ||
# use current tag and not next one | ||
version_scheme = "post-release" |
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,28 @@ | ||
[metadata] | ||
name = ptf | ||
description = The P4 Testing Framework | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown; charset=UTF-8 | ||
url = https://github.com/p4lang/ptf | ||
author = P4 Developers | ||
author_email = p4-dev@lists.p4.org | ||
license = Apache-2.0 | ||
license_files = LICENSE | ||
classifiers = | ||
License :: OSI Approved :: Apache Software License | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
|
||
[options] | ||
package_dir= | ||
=src | ||
packages = find: | ||
scripts = ptf, ptf_nn/ptf_nn_agent.py | ||
platforms = any | ||
python_requires = >=2.7, >=3 | ||
setup_requires = | ||
setuptools_scm | ||
install_requires = file: requirements.txt | ||
|
||
[options.packages.find] | ||
where = src |
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 |
---|---|---|
@@ -1,43 +1,4 @@ | ||
import os | ||
from setuptools import setup | ||
project_root = os.path.dirname(os.path.realpath(__file__)) | ||
import setuptools | ||
|
||
with open(os.path.join(project_root, 'README.md')) as readme_file: | ||
readme = readme_file.read() | ||
|
||
with open("requirements.txt", "r") as req: | ||
requirements = [] | ||
for l in req.readlines(): | ||
requirements.append(l.rstrip()) | ||
|
||
setup( | ||
name='ptf', | ||
version='0.9.3', | ||
description='PTF is a Python based dataplane test framework.', | ||
long_description=readme, | ||
long_description_content_type="text/markdown", | ||
author='Antonin Bas', | ||
author_email='antonin@barefootnetworks.com', | ||
url='https://github.com/p4lang/ptf', | ||
packages=[ | ||
'ptf', 'ptf.platforms', | ||
], | ||
package_dir={'': 'src'}, | ||
scripts=[ | ||
'ptf', | ||
'ptf_nn/ptf_nn_agent.py' | ||
], | ||
install_requires=requirements, | ||
zip_safe=False, | ||
license='Apache License', | ||
keywords='ptf', | ||
classifiers=[ | ||
'Development Status :: 2 - Pre-Alpha', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Natural Language :: English', | ||
'Programming Language :: Python :: 2', | ||
'Programming Language :: Python :: 2.7', | ||
'Programming Language :: Python :: 3', | ||
] | ||
) | ||
if __name__ == "__main__": | ||
setuptools.setup() |