Skip to content

Commit

Permalink
Use pyproject.toml to define PyPI package
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncameron-wk committed Jun 22, 2023
1 parent ccbeead commit 1f04f4f
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 58 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/puppeteer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ jobs:
uses: actions/[email protected]
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
check-latest: true
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
- name: Install Node dependencies
run: npm install --include dev
- name: Install Arelle
run: pip install arelle-release .
- name: Install Python dependencies
run: pip install .[dev]
- name: Build viewer js
run: npm run prod
- name: Generate test viewers
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
uses: actions/[email protected]
with:
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
check-latest: true
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
run: pip install .[dev]
- name: Test with nose2
run: nose2
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ ARG GIT_TAG

WORKDIR /build/

COPY requirements*.txt /build/
COPY pyproject.toml /build/
RUN pip install -U pip setuptools && \
pip install -r requirements-dev.txt
pip install .[dev]

COPY . /build/
COPY --from=node-build /build/iXBRLViewerPlugin/viewer/dist /build/iXBRLViewerPlugin/viewer/dist
Expand All @@ -69,7 +69,7 @@ RUN nose2 --plugin nose2.plugins.junitxml --junit-xml-path ../test_reports/resul

# pypi package creation
ARG BUILD_ARTIFACTS_PYPI=/build/dist/*.tar.gz
RUN python setup.py sdist
RUN python -m build

ARG BUILD_ARTIFACTS_AUDIT=/audit/*
RUN mkdir /audit/
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include README.md
include requirements.txt
graft iXBRLViewerPlugin/viewer/dist
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["setuptools~=65.3", "wheel~=0.37", "setuptools_scm[toml]~=7.0"]
build-backend = "setuptools.build_meta"

[project]
name = "ixbrl-viewer"
dynamic = ['version']
readme = "README.md"
license = {text = "Apache-2.0"}
description = "The Arelle iXBRL Viewer allows iXBRL reports to be viewed interactively in a web browser."
authors = [
{name = "arelle.org", email = "[email protected]"}
]
keywords = ["xbrl"]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Operating System :: OS Independent',
'Topic :: Text Processing :: Markup :: XML'
]
requires-python = ">=3.7"
dependencies = [
'arelle_release==2.4.2',
'lxml>=4.6.3,<5.0.0',
'pycountry>=20.7.3,<21.0.0'
]

[project.optional-dependencies]
dev = [
'mock>=4.0.3,<6.0.0',
'nose2>=0.12.0,<1.0.0'
]

# https://setuptools.pypa.io/en/latest/userguide/entry_point.html#entry-points-for-plugins
[project.entry-points."arelle.plugin"]
ixbrl-viewer = "iXBRLViewerPlugin:load_plugin_url"

[project.urls]
"Homepage" = "https://arelle.org/"
"Downloads" = "https://arelle.org/arelle/pub/"
"Documentation" = "https://arelle.org/arelle/documentation/"
"Blog" = "https://arelle.org/arelle/blog/"
"Source Code" = "https://github.com/workiva/ixbrl-viewer"
"Bug Reports" = "https://github.com/workiva/ixbrl-viewer/issues/"
"Support" = "https://groups.google.com/g/arelle-users/"

[tool.setuptools]
platforms = ["any"]

[tool.setuptools.packages.find]
namespaces = false

[tool.setuptools_scm]
tag_regex = "^(?:[\\w-]+-?)?(?P<version>[vV]?\\d+(?:\\.\\d+){0,2}[^\\+]*)(?:\\+.*)?$"
write_to = "iXBRLViewerPlugin/_version.py"
7 changes: 0 additions & 7 deletions requirements-dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

38 changes: 0 additions & 38 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/puppeteer/tools/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ for file in "$testFilingDir"/*.zip; do
echo "Generating ixbrl-viewer for: $file"
outputFilename=$(basename -- "$file")
viewerName=${outputFilename%.zip}.htm
arelleCmdLine --plugins ixbrl-viewer -f $file --save-viewer $genDir/$viewerName --viewer-url ../../../../iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js
arelleCmdLine --plugins ../../../../iXBRLViewerPlugin -f $file --save-viewer $genDir/$viewerName --viewer-url ../../../../iXBRLViewerPlugin/viewer/dist/ixbrlviewer.js
done
echo "iXBRL-Viewer Generation Complete"

0 comments on commit 1f04f4f

Please sign in to comment.