Skip to content
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
Empty file added .coveragerc
Empty file.
30 changes: 0 additions & 30 deletions .github/workflows/create-release.yml

This file was deleted.

58 changes: 44 additions & 14 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# https://pypi.org/project/ldcoolp-figshare/
# Some syntax from:
# https://github.com/FootBrawlers/robosoft/blob/f06cfcd8443b33eb258e59a054c7d210fa896dad/.github/workflows/pypi-release.yml
# and https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: Publish to PyPI

Expand All @@ -12,30 +13,59 @@ on:
- 'v*' # Push events to matching v*

jobs:
package-n-publish:
package-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: "3.11"
- name: Install PyPI dependencies
run: |
python -m pip install --user --upgrade setuptools wheel
- name: Build
run: |
python setup.py sdist bdist_wheel
- name: upload distribution package
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ github.ref_name }}
path: dist/

publish-to-testpypi:
needs: [package-build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/ldcoolp-figshare/
permissions:
id-token: write
steps:
- name: download distribution package
uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ github.ref_name }}
path: dist/
- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1.13
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
repository-url: https://test.pypi.org/legacy/

publish-to-pypi:
needs: [package-build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ldcoolp-figshare/
permissions:
id-token: write
steps:
- name: download distribution package
uses: actions/download-artifact@v4
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
name: ${{ github.event.repository.name }}-${{ github.ref_name }}
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.13
53 changes: 53 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package

on:
push:
paths-ignore:
- '**.md'
- '**.png'
- 'img/*'
- 'LICENSE'
- '.gitignore'
- 'docs/**'
pull_request:
paths-ignore:
- '**.md'
- '**.png'
- 'img/*'
- 'LICENSE'
- '.gitignore'
- 'docs/**'

jobs:
build-n-test:

runs-on: ubuntu-latest
# See: https://github.com/marketplace/actions/skip-based-on-commit-message
if: "!contains(github.event.head_commit.message, 'docs only')"
strategy:
matrix:
python_version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
- name: Install setuptools for python 3.12 and 3.13
if: matrix.python_version != '3.11'
run: |
python -m pip install setuptools
python -m pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
python setup.py install
python -m pip list
- name: Test with pytest
run: |
pytest --cov-report term-missing --cov-config=.coveragerc --cov=ldcoolp-figshare tests
4 changes: 2 additions & 2 deletions .github/workflows/sphinx-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:

steps:
- name: Checkout ldcoolp-figshare
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Sphinx build
uses: ammaraskar/sphinx-action@master
uses: ammaraskar/sphinx-action@8.2.3
with:
docs-folder: "docs/"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ MANIFEST
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
# Unit tests / coverage reports
htmlcov/
.tox/
.nox/
Expand Down
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
redata>=0.4.1
redata>=0.6.0

sphinx>=4.0
sphinx-rtd-theme==0.5.2
sphinx-autodoc-typehints==1.12.0
sphinx>=8.0.0
sphinx-rtd-theme==3.0.2
sphinx-autodoc-typehints==3.2.0
4 changes: 1 addition & 3 deletions docs/source/authors.rst
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Authors
-------

- Chun Ly, Ph.D. (`@astrochun`_) -
`University of Arizona Libraries`_, `Research Engagement`_
- `University of Arizona Libraries`_, `Research Engagement`_

See also the list of :repo:`contributors <contributors>` who participated in this project.

.. _@astrochun: http://www.github.com/astrochun
.. _University of Arizona Libraries: https://github.com/ualibraries
.. _Research Engagement: https://github.com/UAL-RE
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

project = 'ldcoolp-figshare'
copyright = '2021, Arizona Board of Regents'
author = 'Chun Ly, UA Research Data Repository (ReDATA) Team'
author = 'Research Engagement (University of Arizona Libraries)'

# The full version, including alpha/beta/rc tags
release = 'v0.3.2'
release = 'v0.4.0'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Getting Started
---------------

You will need Python. We recommend v3.9. This code will be tested with
v3.7, v3.8, and v3.9.
You will need Python. We recommend v3.11 or greater. This code will be tested with
v3.11, v3.12, and v3.13.

This code is published as ``ldcoolp-figshare`` on :pypi:`PyPI <>`. Thus, the
simplest installation is:
Expand Down
2 changes: 1 addition & 1 deletion ldcoolp_figshare/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "0.3.2"
__version__ = "0.4.0"

from .main import FigshareInstituteAdmin
2 changes: 1 addition & 1 deletion ldcoolp_figshare/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def get_account_list(self, process: bool = True) -> \
accounts_df = accounts_df.drop(columns='institution_id')

if self.ignore_admin:
self.log.info("Excluding administrative and test accounts")
self.log.info("Excluding administrative and tests accounts")

drop_index = []
for ia in self.admin_filter:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
redata==0.4.1
redata==0.6.0
14 changes: 7 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='ldcoolp-figshare',
version='0.3.2',
version='0.4.0',
packages=find_namespace_packages(),
url='https://github.com/UAL-RE/ldcoolp-figshare/',
project_urls={
Expand All @@ -17,18 +17,18 @@
'Tracker': 'https://github.com/UAL-RE/ldcoolp-figshare/issues',
},
license='MIT License',
author='Chun Ly',
author_email='astro.chun@gmail.com',
author='Research Engagement (University of Arizona Libraries)',
author_email='redata@arizona.edu',
description='Python tool using the Figshare API for data curation',
long_description=long_description,
long_description_content_type='text/markdown',
python_requires='>=3.7',
python_requires='>=3.11',
install_requires=requirements,
classifiers=[
'Development Status :: 4 - Beta',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9'
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13'
]
)
Empty file added tests/__init__.py
Empty file.
8 changes: 8 additions & 0 deletions tests/test_endpoint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from ldcoolp_figshare.main import FigshareInstituteAdmin

token = "token_dummy_1234567890abcdef"
inst_admin = FigshareInstituteAdmin(token)

def test_endpoint():
api_endpoint = "get_curation_list"
assert inst_admin.endpoint(api_endpoint) == "https://api.figshare.com/v2/account/institution/get_curation_list"