Skip to content

Commit

Permalink
Aright lets see if we can publish it as a pip package
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoldverg committed Jan 18, 2024
1 parent 6ec1c71 commit 69545c1
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 52 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: OneDataShare CLI

on:
release:
types: [created]

jobs:
pypi-publish:
name: Publish release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/odscli
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build package
run: |
python setup.py sdist bdist_wheel # Could also be python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
OneDataShare Python Command Line Interface
==========

Installation & Setup
-------
#TODO
**Require Packages,**
pip3 install -r requirements.txt
**Quick Install VIA PIP,**
**Remove interactive features,**

**Examples**
```python
python3 onedatashare.py transfer s3 us-east-2:::testbucket "/" -f folderOrFileAnyNumber/ sftp ccTacc /home/cc/certs --concurrency=6 --pipesize=10
```
OneDataShare Python Command Line Interface
1 change: 1 addition & 0 deletions _version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.9.1"
1 change: 0 additions & 1 deletion sdk/meta_query_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __init__(self):
self.log = Log()

def finished_job_stdout(self, batch_job_cdb, output_file, job_id):

df = pd.json_normalize(batch_job_cdb)
job_size = (int(batch_job_cdb['jobParameters']['jobSize']) / 1000000) * 8 # convert Bytes to MB then to Mb
self.job_batch_df = transform_start_end_last(df)
Expand Down
68 changes: 32 additions & 36 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,33 @@
from setuptools import setup, find_packages

setup(

name ='cmdline',

version ='1.0.0',

author ='Admin OneDataShare',

author_email ='[email protected]',

description ='Demo Package for CLI',

packages = find_packages(),

entry_points ={

'console_scripts': [

'main = cmdline:main'

]

},

classifiers =(

"Programming Language :: Python :: 3",

"Operating System :: OS Independent",

),


zip_safe = False
import setuptools, os

with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
requirements = f.readlines()
with open("_version.py", encoding='utf-8') as f:
version = f.read().strip().split(" = ")[1][1:-1]

setuptools.setup(
name="odscli",
version=version,
author="OneDataShare",
author_email="[email protected]",
description="The onedatashare.org cli",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/didclab/odscli",
project_urls={},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
packages=setuptools.find_packages(exclude=['tests']),
entry_points={
'console_scripts': [
'ods = odscli:main'
]
},
install_requires=[requirements],
python_requires=">=3.10",
)

0 comments on commit 69545c1

Please sign in to comment.