Skip to content

Commit e149282

Browse files
committed
merge #180 into master
2 parents ba4bf75 + 7fb188d commit e149282

60 files changed

Lines changed: 322 additions & 422 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build PyDataverse
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
python-version: ["3.8", "3.9", "3.10", "3.11"]
10+
name: Build pyDataverse
11+
steps:
12+
- name: "Checkout"
13+
uses: "actions/checkout@v4"
14+
- name: Setup Python
15+
uses: actions/setup-python@v3
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- name: Install Python Dependencies
19+
run: |
20+
python3 -m pip install --upgrade pip
21+
python3 -m pip install poetry
22+
23+
poetry install

.github/workflows/lint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Ruff
2+
on: [push, pull_request]
3+
jobs:
4+
ruff:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: chartboost/ruff-action@v1

.github/workflows/publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build and publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: "Build and publish to PyPi"
14+
uses: JRubics/poetry-publish@v1.17
15+
with:
16+
pypi_token: ${{ secrets.PYPI_TOKEN }}
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,8 @@ jobs:
55
custom_test:
66
runs-on: ubuntu-latest
77
strategy:
8-
matrix:
9-
python-version: [
10-
"3.8",
11-
"3.9",
12-
"3.10",
13-
"3.11"
14-
]
8+
matrix:
9+
python-version: ["3.8", "3.9", "3.10", "3.11"]
1510
name: Test pyDataverse
1611
env:
1712
PORT: 8080
@@ -28,13 +23,15 @@ jobs:
2823
- name: Install Python Dependencies
2924
run: |
3025
python3 -m pip install --upgrade pip
31-
python3 -m pip install -r ./requirements/tests.txt
32-
pip install -e .
26+
python3 -m pip install poetry
27+
28+
poetry install --with tests
29+
3330
- name: Run tests
3431
env:
3532
API_TOKEN_SUPERUSER: ${{ steps.dataverse.outputs.api_token }}
3633
API_TOKEN: ${{ steps.dataverse.outputs.api_token }}
3734
BASE_URL: ${{ steps.dataverse.outputs.base_url }}
3835
DV_VERSION: ${{ steps.dataverse.outputs.dv_version }}
3936
run: |
40-
python3 -m pytest
37+
python3 -m poetry run pytest

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,9 @@ src/pyDataverse/docs/source/_build
164164
src/pyDataverse/docs/Makefile
165165
env-config/
166166
wiki/
167+
168+
# Poetry lock
169+
poetry.lock
170+
171+
# Ruff
172+
.ruff_cache/

.pre-commit-config.yaml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
default_language_version:
2-
python: python3
2+
python: python3
33
exclude: ^migrations/
44
repos:
5-
- repo: https://github.com/pre-commit/pre-commit-hooks
6-
rev: v2.4.0
7-
exclude: _pytest/(debugging|hookspec).py
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.6.0
87
hooks:
9-
- id: check-added-large-files
10-
- id: check-case-conflict
11-
- id: check-docstring-first
12-
- id: check-json
13-
- id: check-symlinks
14-
- id: check-xml
15-
- id: check-yaml
16-
- id: detect-private-key
17-
- id: end-of-file-fixer
18-
- id: pretty-format-json
19-
args: [--autofix,--no-sort-keys]
20-
- repo: https://github.com/psf/black
21-
rev: 19.10b0
8+
- id: check-added-large-files
9+
- id: check-case-conflict
10+
- id: check-docstring-first
11+
- id: check-json
12+
- id: check-symlinks
13+
- id: check-xml
14+
- id: check-yaml
15+
- id: detect-private-key
16+
- id: end-of-file-fixer
17+
- id: pretty-format-json
18+
args: [--autofix, --no-sort-keys]
19+
20+
- repo: https://github.com/astral-sh/ruff-pre-commit
21+
rev: v0.4.4
2222
hooks:
23-
- id: black
24-
language_version: python3.6
25-
- repo: https://github.com/asottile/blacken-docs
23+
- id: ruff
24+
args: [--fix]
25+
- id: ruff-format
26+
27+
- repo: https://github.com/asottile/blacken-docs
2628
rev: v1.7.0
2729
hooks:
28-
- id: blacken-docs
30+
- id: blacken-docs
2931
additional_dependencies: [black==19.10b0]
3032

31-
- repo: https://github.com/codespell-project/codespell
32-
# Configuration for codespell is in setup.cfg
33-
rev: v2.2.6
34-
hooks:
35-
- id: codespell
33+
- repo: https://github.com/codespell-project/codespell
34+
# Configuration for codespell is in setup.cfg
35+
rev: v2.2.6
36+
hooks:
37+
- id: codespell

.readthedocs.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
44

55
# Required
6-
version: 2
6+
version: 2
77

88
# Build documentation in the docs/ directory with Sphinx
99
sphinx:
10-
configuration: src/pyDataverse/docs/source/conf.py
10+
configuration: pyDataverse/docs/source/conf.py
1111

1212
# Optionally build your docs in additional formats such as PDF and ePub
13-
formats: all
13+
formats: all
1414

1515
# Optionally set the version of Python and requirements required to build your docs
1616
python:
17-
version: 3.6
18-
install:
19-
- requirements: requirements/docs.txt
20-
- method: pip
21-
path: .
22-
system_packages: true
17+
version: 3.6
18+
install:
19+
- requirements: requirements/docs.txt
20+
- method: pip
21+
path: .
22+
system_packages: true

CONTRIBUTING.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ you created the branch, check the section on
229229
:ref:`updating a PR <contributing_changes_update-pull-request>`.
230230

231231

232-
From here, you now can move forward to
232+
From here, you now can move forward to
233233

234234
- contribute to the documentation (see below)
235235
- contribute to the :ref:`code base <contributing_code>`
@@ -267,7 +267,7 @@ Some other important things to know about the docs:
267267
- The pyDataverse documentation consists of two parts:
268268

269269
- the docstrings in the code itself and
270-
- the docs in the folder ``src/pyDataverse/doc/``
270+
- the docs in the folder ``pyDataverse/doc/``
271271

272272
- The docstrings provide a clear explanation of the usage of the individual functions, while the documentation consists of tutorial-like overviews per topic together with some other information (what’s new, installation, this page you're viewing right now, etc).
273273
- The docstrings follow the `Numpy Docstring Standard <https://numpydoc.readthedocs.io/en/latest/format.html>`_.
@@ -298,7 +298,7 @@ to ``upstream/develop``, so you have to branch-off from it too.
298298
299299
There is one exception: If you
300300
want to suggest a change to the docs in the folder
301-
``src/pyDataverse/docs/`` (e. g. fix a typo in
301+
``pyDataverse/docs/`` (e. g. fix a typo in
302302
:ref:`User Guide - Basic Usage <user_basic-usage>`),
303303
you can also pull to ``upstream/master``. This means, you have also to
304304
branch-off from the ``master`` branch.
@@ -411,7 +411,7 @@ To run black alone, use
411411

412412
.. code-block:: shell
413413
414-
black src/pyDataverse/file_changed.py
414+
black pyDataverse/file_changed.py
415415
416416
417417
.. _contributing_code_type-hints:
@@ -430,7 +430,7 @@ type hints. After making any change you can ensure your type hints are correct b
430430

431431
.. code-block:: shell
432432
433-
mypy src/pyDataverse/file_changed.py
433+
mypy pyDataverse/file_changed.py
434434
435435
436436
.. _contributing_code_testing-with-ci:

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
recursive-include src/pyDataverse/schemas *
1+
recursive-include pyDataverse/schemas *
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77

88
from __future__ import absolute_import
99

10-
import urllib3
11-
12-
urllib3.disable_warnings() # noqa
1310

1411
__author__ = "Stefan Kasberger"
1512
__email__ = "stefan.kasberger@univie.ac.at"
1613
__copyright__ = "Copyright (c) 2019 Stefan Kasberger"
1714
__license__ = "MIT License"
18-
__version__ = "0.3.1"
15+
__version__ = "0.3.2"
1916
__url__ = "https://github.com/GDCC/pyDataverse"
2017
__download_url__ = "https://pypi.python.org/pypi/pyDataverse"
2118
__description__ = "A Python module for Dataverse."

0 commit comments

Comments
 (0)