-
Notifications
You must be signed in to change notification settings - Fork 14
Updated scikit package #227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
428e874
b9f9b35
74b5fc9
e99010e
7d56dfe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,76 @@ | ||
| name: Build Wheel, Release on GitHub/PyPI, and Deploy Docs | ||
| name: Build Wheel and Release | ||
|
|
||
| # Trigger on tag push or manual dispatch. | ||
| # Tag and release privilege are verified inside the reusable workflow. | ||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml | ||
| - "*" | ||
|
|
||
| # ── Release modality ────────────────────────────────────────────────────────── | ||
| # Three options are provided below. Only ONE job should be active at a time. | ||
| # To switch: comment out the active job and uncomment your preferred option, | ||
| # then commit the change to main before tagging a release. | ||
| # ───────────────────────────────────────────────────────────────────────────── | ||
|
|
||
| jobs: | ||
| # Option 1 (default): Release to GitHub, publish to PyPI, and deploy docs. | ||
| # | ||
| # The wheel is uploaded to PyPI so users can install with `pip install`. | ||
| # A GitHub release is created with the changelog as the release body, and | ||
| # the Sphinx documentation is rebuilt and deployed to GitHub Pages. | ||
| # | ||
| # Choose this for open-source packages distributed via PyPI and/or | ||
| # conda-forge where broad public availability is the goal. | ||
| build-release: | ||
| uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 | ||
| with: | ||
| project: diffpy.labpdfproc | ||
| c_extension: false | ||
| maintainer_GITHUB_username: sbillinge | ||
| maintainer_github_username: sbillinge | ||
| secrets: | ||
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
|
|
||
| # Option 2: Release to GitHub and deploy docs, without publishing to PyPI. | ||
| # | ||
| # A GitHub release is created and the Sphinx docs are deployed, but the | ||
| # wheel is not uploaded to PyPI. The source code remains publicly visible | ||
| # on GitHub and can be installed directly from there. | ||
| # | ||
| # Choose this when the package is public but you prefer to keep it off the | ||
| # default pip index — for example, if you distribute via conda-forge only, | ||
| # or if the package is not yet ready for a permanent PyPI presence. | ||
| # | ||
| # To use: comment out Option 1 above and uncomment the lines below. | ||
| # build-release-no-pypi: | ||
| # uses: scikit-package/release-scripts/.github/workflows/_build-release-github-no-pypi.yml@v0 | ||
| # with: | ||
| # project: diffpy.labpdfproc | ||
| # c_extension: false | ||
| # maintainer_github_username: sbillinge | ||
| # secrets: | ||
| # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
|
|
||
| # Option 3: Release to GitHub with wheel, license, and instructions bundled | ||
| # as a downloadable zip attached to the GitHub release asset. | ||
| # | ||
| # The wheel is built and packaged together with INSTRUCTIONS.txt and the | ||
| # LICENSE file into a zip that is attached directly to the GitHub release. | ||
| # Users with access to the (private) repo download the zip, follow the | ||
| # instructions inside, and install locally with pip. No PyPI or conda-forge | ||
| # upload occurs, and no docs are deployed. | ||
| # | ||
| # Choose this for private or restricted packages where distribution must be | ||
| # controlled: only users with repo access can download the release asset, | ||
| # making the GitHub release itself the distribution channel. | ||
| # | ||
| # To use: comment out Option 1 above and uncomment the lines below. | ||
| # build-release-private: | ||
| # uses: scikit-package/release-scripts/.github/workflows/_build-release-github-private-pure.yml@v0 | ||
| # with: | ||
| # project: diffpy.labpdfproc | ||
| # maintainer_github_username: sbillinge | ||
| # secrets: | ||
| # PAT_TOKEN: ${{ secrets.PAT_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,36 @@ | ||
| @ECHO OFF | ||
|
|
||
| pushd %~dp0 | ||
|
|
||
| REM Command file for Sphinx documentation | ||
|
|
||
| if "%SPHINXBUILD%" == "" ( | ||
| set SPHINXBUILD=sphinx-build | ||
| ) | ||
| set SOURCEDIR=source | ||
| set BUILDDIR=build | ||
| set SPHINXPROJ=PackagingScientificPython | ||
|
|
||
| if "%1" == "" goto help | ||
|
|
||
| %SPHINXBUILD% >NUL 2>NUL | ||
| if errorlevel 9009 ( | ||
| echo. | ||
| echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
| echo.installed, then set the SPHINXBUILD environment variable to point | ||
| echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
| echo.may add the Sphinx directory to PATH. | ||
| echo. | ||
| echo.If you don't have Sphinx installed, grab it from | ||
| echo.http://sphinx-doc.org/ | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
| goto end | ||
|
|
||
| :help | ||
| %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
|
|
||
| :end | ||
| popd | ||
| @ECHO OFF | ||
| pushd %~dp0 | ||
| REM Command file for Sphinx documentation | ||
| if "%SPHINXBUILD%" == "" ( | ||
| set SPHINXBUILD=sphinx-build | ||
| ) | ||
| set SOURCEDIR=source | ||
| set BUILDDIR=build | ||
| set SPHINXPROJ=PackagingScientificPython | ||
| if "%1" == "" goto help | ||
| %SPHINXBUILD% >NUL 2>NUL | ||
| if errorlevel 9009 ( | ||
| echo. | ||
| echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
| echo.installed, then set the SPHINXBUILD environment variable to point | ||
| echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
| echo.may add the Sphinx directory to PATH. | ||
| echo. | ||
| echo.If you don't have Sphinx installed, grab it from | ||
| echo.http://sphinx-doc.org/ | ||
| exit /b 1 | ||
| ) | ||
| %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
| goto end | ||
| :help | ||
| %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% | ||
| :end | ||
| popd |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * migrated `labpdfproc` to a latest scikit-package level | ||
|
|
||
| **Changed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,9 +45,6 @@ template = "{tag}" | |
| dev_template = "{tag}" | ||
| dirty_template = "{tag}" | ||
|
|
||
| [project.scripts] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removing this is probably breaking things too, but do check. |
||
| labpdfproc = "diffpy.labpdfproc.labpdfprocapp:main" | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| where = ["src"] # list of folders that contain the packages (["."] by default) | ||
| include = ["*"] # package names should match these glob patterns (["*"] by default) | ||
|
|
@@ -57,6 +54,9 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default) | |
| [tool.setuptools.package-data] | ||
| "diffpy.labpdfproc" = ["data/*"] | ||
|
|
||
| [project.scripts] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we probably don't need this |
||
| labpdfproc = "diffpy.labpdfproc.app:main" | ||
|
|
||
| [tool.setuptools.dynamic] | ||
| dependencies = {file = ["requirements/pip.txt"]} | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import argparse | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think labpdfproc as apps so we probably don't want this auto-generated one. I suggest to run the old version of the code to understand how it works, and then to make sure that it still works the same way after migrating. |
||
|
|
||
| from diffpy.labpdfproc.version import __version__ # noqa | ||
|
|
||
|
|
||
| def main(): | ||
| parser = argparse.ArgumentParser( | ||
| prog="diffpy.labpdfproc", | ||
| description=( | ||
| "Tools for processing x-ray " | ||
| "powder diffraction data " | ||
| " from laboratory sources.\n\n" | ||
| "For more information, visit: " | ||
| "https://github.com/diffpy/diffpy.labpdfproc/" | ||
| ), | ||
| formatter_class=argparse.RawDescriptionHelpFormatter, | ||
| ) | ||
|
|
||
| parser.add_argument( | ||
| "--version", | ||
| action="store_true", | ||
| help="Show the program's version number and exit", | ||
| ) | ||
|
|
||
| args = parser.parse_args() | ||
|
|
||
| if args.version: | ||
| print(f"diffpy.labpdfproc {__version__}") | ||
| else: | ||
| # Default behavior when no arguments are given | ||
| parser.print_help() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is probably better as a fixed?