From d6fc863acbeb524e3b94ec5fed3181e784699991 Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 12:36:53 -0500 Subject: [PATCH 1/3] skpkg: add CHAGELOG.rst, README.rst, license, update pyproject.toml --- CHANGELOG.rst | 68 ----------------------------------------- README.rst | 40 +++++++++++------------- docs/source/license.rst | 52 ++++++++++++++----------------- pyproject.toml | 3 ++ 4 files changed, 43 insertions(+), 120 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1253f93..f29d3b5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,71 +3,3 @@ Release notes ============= .. current developments - -1.5.1 -===== - -**Fixed:** - -* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. - -**Removed:** - -* Removed `restore_stdout` function and wrapper. - - -1.5.0 -===== - -**Added:** - -* Python 3.11, 3.12 support -* Option to skip printing of introductory information when initializing the `PdfFit` class. -* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. -* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. -* Separate installation instruction for macOS (Arm64) in READEM -* Added `restore_stdout` function and wrapper. -* Added Python 3.13 support. - -**Changed:** - -* Changed setup.py to lazy evaluate gsl installation. -* Documentation brought up to date -* Merged the GSL configuration logic in `setup.py`. -* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. - -**Fixed:** - -* remove older conda-recipe files -* moved the tests directory from src to the root using conftest.py. -* fixed a circular import bug during " pip install ." in GitHub CI. -* renamed .py files under tests to snake_case. -* add PyPI packages under pip.txt -* re-cookiecutter to group's package standard -* Fix missing `__date__`, use PyPI release date. -* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. - -**Removed:** - -* Python <= 3.10 support -* Six dependency and py2 support - - -1.4.2 -===== - -**Added:** - -* Support for Python 3.11, 3.12 - -**Changed:** - -* No notable functional changes from 1.4.1 - -1.4.4rc0 -======== - -**Fixed:** - -* Code linted to group flake8 standards -* Package structure moved to diffpy standard structure diff --git a/README.rst b/README.rst index 4c90e84..dfbcd71 100644 --- a/README.rst +++ b/README.rst @@ -25,6 +25,7 @@ :target: https://anaconda.org/conda-forge/diffpy.pdffit2 .. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff + :target: https://github.com/diffpy/diffpy.pdffit2/pulls .. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.pdffit2 :target: https://pypi.org/project/diffpy.pdffit2/ @@ -78,11 +79,6 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ -diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13. - -Windows, macOS (non-Arm64), Linux -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. @@ -97,34 +93,32 @@ The following creates and activates a new environment named ``diffpy.pdffit2_env conda create -n diffpy.pdffit2_env diffpy.pdffit2 conda activate diffpy.pdffit2_env -To confirm that the installation was successful, type :: - - python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" - -macOS (Arm64) -~~~~~~~~~~~~~ +The output should print the latest version displayed on the badges above. -Create a new conda environment ``diffpy.pdffit2_env``: :: +If the above does not work, you can use ``pip`` to download and install the latest release from +`Python Package Index `_. +To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: - conda create -n diffpy.pdffit2_env python=3.13 + pip install diffpy.pdffit2 -Activate the environment: :: +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory +and run the following :: - conda activate diffpy.pdffit2_env + pip install . -Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: +This package also provides command-line utilities. To check the software has been installed correctly, type :: - pip install diffpy.pdffit2 + diffpy.pdffit2 --version -To confirm that the installation was successful, type :: +You can also type the following command to verify the installation. :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -If you prefer to install from sources, after installing the dependencies, obtain the source archive from -`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdffit2`` directory -and run the following :: - pip install . +To view the basic usage and available commands, type :: + + diffpy.pdffit2 -h Getting Started --------------- @@ -170,7 +164,7 @@ trying to commit again. Improvements and fixes are always appreciated. -Before contributing, please read our `Code of Conduct `_. +Before contributing, please read our `Code of Conduct `_. Contact ------- diff --git a/docs/source/license.rst b/docs/source/license.rst index fbdd3ed..5cdf347 100644 --- a/docs/source/license.rst +++ b/docs/source/license.rst @@ -25,32 +25,26 @@ For more information please visit the project web-page: or email Prof. Simon Billinge at sb2896@columbia.edu Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - * Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER -EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER -EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY -FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM -INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE -SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL -COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/pyproject.toml b/pyproject.toml index af52ce0..959054d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,9 @@ include = ["*"] # package names should match these glob patterns (["*"] by defa exclude = [] # exclude packages matching these glob patterns (empty by default) namespaces = false # to disable scanning PEP 420 namespaces (true by default) +[project.scripts] +diffpy-pdffit2 = "diffpy.pdffit2_app:main" + [tool.setuptools.dynamic] dependencies = {file = ["requirements/pip.txt"]} From a0d4c2c4ebb3de19351167b7297cc41c2ccccddd Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 13:24:55 -0500 Subject: [PATCH 2/3] chore: Add instructions back to README.rst and revert history of CHANGELOG.rst --- CHANGELOG.rst | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 25 ++++++++++++------- 2 files changed, 84 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f29d3b5..1253f93 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,3 +3,71 @@ Release notes ============= .. current developments + +1.5.1 +===== + +**Fixed:** + +* Fixed `SystemError` and `MemoryError` for `redirect_stdout` on Windows with Python 3.13. + +**Removed:** + +* Removed `restore_stdout` function and wrapper. + + +1.5.0 +===== + +**Added:** + +* Python 3.11, 3.12 support +* Option to skip printing of introductory information when initializing the `PdfFit` class. +* Added additional runtime linker flags in `CustomBuildExt.run` to embed the `RPATH` flags for the built extensions. +* Support for retrieving GSL configuration from `CONDA_PREFIX`/ `GSL_PATH` on all platforms. +* Separate installation instruction for macOS (Arm64) in READEM +* Added `restore_stdout` function and wrapper. +* Added Python 3.13 support. + +**Changed:** + +* Changed setup.py to lazy evaluate gsl installation. +* Documentation brought up to date +* Merged the GSL configuration logic in `setup.py`. +* Changed `pytest` `capture_output` fixture. Now automatically restores `sys.stdout`. + +**Fixed:** + +* remove older conda-recipe files +* moved the tests directory from src to the root using conftest.py. +* fixed a circular import bug during " pip install ." in GitHub CI. +* renamed .py files under tests to snake_case. +* add PyPI packages under pip.txt +* re-cookiecutter to group's package standard +* Fix missing `__date__`, use PyPI release date. +* Fixed `SystemError` when running `pytest` on Windows with Python 3.13. + +**Removed:** + +* Python <= 3.10 support +* Six dependency and py2 support + + +1.4.2 +===== + +**Added:** + +* Support for Python 3.11, 3.12 + +**Changed:** + +* No notable functional changes from 1.4.1 + +1.4.4rc0 +======== + +**Fixed:** + +* Code linted to group flake8 standards +* Package structure moved to diffpy standard structure diff --git a/README.rst b/README.rst index dfbcd71..9ca91b8 100644 --- a/README.rst +++ b/README.rst @@ -79,6 +79,11 @@ If you use diffpy.pdffit2 in a scientific publication, we would like you to cite Installation ------------ +diffpy.pdffit2 supports Python 3.11, 3.12, and 3.13. + +Windows, macOS (non-Arm64), Linux +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The preferred method is to use `Miniconda Python `_ and install from the "conda-forge" channel of Conda packages. @@ -93,7 +98,16 @@ The following creates and activates a new environment named ``diffpy.pdffit2_env conda create -n diffpy.pdffit2_env diffpy.pdffit2 conda activate diffpy.pdffit2_env -The output should print the latest version displayed on the badges above. +To confirm that the installation was successful, type :: + + python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" + +macOS (Arm64) +~~~~~~~~~~~~~ + +Create a new conda environment ``diffpy.pdffit2_env``: :: + + conda create -n diffpy.pdffit2_env python=3.13 If the above does not work, you can use ``pip`` to download and install the latest release from `Python Package Index `_. @@ -107,19 +121,12 @@ and run the following :: pip install . -This package also provides command-line utilities. To check the software has been installed correctly, type :: - - diffpy.pdffit2 --version -You can also type the following command to verify the installation. :: +You can type the following command to verify the installation is successful. :: python -c "import diffpy.pdffit2; print(diffpy.pdffit2.__version__)" -To view the basic usage and available commands, type :: - - diffpy.pdffit2 -h - Getting Started --------------- From f795440d588e1d52f8c9e4153cd3730f8404c28f Mon Sep 17 00:00:00 2001 From: stevenhua0320 Date: Thu, 20 Nov 2025 13:30:28 -0500 Subject: [PATCH 3/3] chore: add activate for env to make consistent. --- README.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9ca91b8..0adcc4b 100644 --- a/README.rst +++ b/README.rst @@ -109,9 +109,11 @@ Create a new conda environment ``diffpy.pdffit2_env``: :: conda create -n diffpy.pdffit2_env python=3.13 -If the above does not work, you can use ``pip`` to download and install the latest release from -`Python Package Index `_. -To install using ``pip`` into your ``diffpy.pdffit2_env`` environment, type :: +Activate the environment: :: + + conda activate diffpy.pdffit2_env + +Install pdffit2 using ``pip`` to download and install the latest version from `Python Package Index `_: :: pip install diffpy.pdffit2