Skip to content

Commit

Permalink
Merge pull request #16 from lindsay-stevens/update-packaging
Browse files Browse the repository at this point in the history
Update packaging
  • Loading branch information
lindsay-stevens authored Mar 6, 2023
2 parents 366f652 + 983b795 commit 866cf62
Show file tree
Hide file tree
Showing 20 changed files with 105 additions and 184 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build

on: [push, pull_request]

jobs:

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python: ['3.9']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

# Install dependencies.
- uses: actions/cache@v3
name: Python cache with dependencies.
id: python-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev_requirements.pip') }}
- name: Install dependencies.
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.pip
pip list
# Build and Upload.
- name: Build sdist and wheel.
run: |
pip install wheel
rm -rf build dist *.egg-info
python setup.py sdist bdist_wheel
# Check.
- name: Check dist with twine
run: |
pip install twine
twine check dist/*
- name: Upload sdist and wheel.
if: success()
uses: actions/upload-artifact@v3
with:
name: limesurveyrc2api--on-${{ matrix.os }}--py${{ matrix.python }}
path: ${{ github.workspace }}/dist/limesurveyrc2api*
80 changes: 13 additions & 67 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,69 +1,15 @@
# Common editing files.
*.pyc
__pycache__
dist/
build/
*.egg-info/
*.swp
.DS_Store
.idea
*.iml
.vscode

# Folders created by setuptools.
build
dist
*.egg-info

# Pypi manifest.
MANIFEST

# config files as they usually contain confidential information
*.ini

# Seems to be a user-specific config directory, with path to the project SDK (python interpreter)
.idea/**/misc.xml




# If using IntelliJ, ignore all the things
# Add project-specific ignores above, below is copied from:
# https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore

# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/codeStyleSettings.xml

This file was deleted.

22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/deployment.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/encodings.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/inspectionProfiles/profiles_settings.xml

This file was deleted.

14 changes: 0 additions & 14 deletions .idea/limesurveyrc2api.iml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014 Lindsay Stevens, UNSW Australia
Copyright (c) 2023 Lindsay Stevens

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
This module provides a class which can be used as a client for interacting with LimeSurvey Remote Control 2 API.


### Install
From pip:
```shell
pip install limesurveyrc2api
```

or from GitHub, for example using the master branch:
```shell
pip install https://github.com/lindsay-stevens/limesurveyrc2api/archive/master.zip
```


### Example Usage

The tests are a good place to refer to for api usage, until proper docs are written, anyway. Here is how to get a list of surveys.
Expand Down Expand Up @@ -57,6 +69,26 @@ Where possible, error messages from the RC2API are translated into Python except

## Development

### Setup
```shell
# Get a copy of the repository.
mkdir -P ~/repos/limesurveyrc2api
cd ~/repos/limesurveyrc2api
git clone https://github.com/lindsay-stevens/limesurveyrc2api.git repo

# Create and activate a virtual environment for the install.
/usr/local/bin/python3.9 -m venv venv
source venv/bin/activate

# Install limesurveyrc2api, and it's development dependencies.
cd ~/repos/limesurveyrc2api/repo
pip install -e .
pip install -r dev_requirements.pip

# Leave the virtualenv.
deactivate
```


### References

Expand Down
2 changes: 2 additions & 0 deletions dev_requirements.pip
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-e .
aiosmtpd==1.0.0
2 changes: 1 addition & 1 deletion limesurveyrc2api/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2017.1"
__version__ = "2.0.0"
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
from setuptools import setup
from setuptools import find_packages, setup
from limesurveyrc2api import __version__

setup(
name="limesurveyrc2api",
version=__version__,
description="LimeSurvey RC2 API Web Services Client",
long_description=open("README.md", "r").read(),
long_description_content_type="text/markdown",
url="https://github.com/lindsay-stevens",
author="Lindsay Stevens",
author_email="[email protected]",
packages=["limesurveyrc2api"],
packages=find_packages(exclude=["tests", "tests.*"]),
test_suite="tests",
include_package_data=True,
license="MIT",
install_requires=[
# see requirements.txt
"requests==2.28.2",
],
keywords="limesurvey api webservice client",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.9",
],
)

0 comments on commit 866cf62

Please sign in to comment.