Skip to content

Add CI for [Test]PyPi #36

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

Merged
merged 31 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a9dd6aa
Add pypi test ci
janbridley Feb 3, 2025
366452a
Test CI on pr
janbridley Feb 3, 2025
c96ad41
Correct name of dependency script
janbridley Feb 3, 2025
e7ea61d
Clean up trigger logic
janbridley Feb 3, 2025
94252f7
Simplify script names
janbridley Feb 3, 2025
073a271
Remove unnecessary label
janbridley Feb 3, 2025
46932a3
Update .github/workflows/pypi-test-publish.yaml
janbridley Feb 19, 2025
094f1e8
Update .github/workflows/pypi-test-publish.yaml
janbridley Feb 19, 2025
70d12ce
Swap to specific version tags
janbridley Feb 19, 2025
edab244
Fix indentation
janbridley Feb 19, 2025
257207e
Rename workflow file
janbridley Feb 19, 2025
8582007
Move tags to correct position
janbridley Feb 19, 2025
e1defb6
Set verbose=True
janbridley Feb 19, 2025
bd2d3c2
Fix package name to match pypi
janbridley Feb 19, 2025
10cbe54
Remove broken requirements workflow
janbridley Feb 19, 2025
9721649
Fix reference to README.rst
janbridley Feb 19, 2025
15417c0
Fix README links
janbridley Feb 19, 2025
c0b4084
Fix LICENSE
janbridley Feb 19, 2025
04a9971
Run fix-license-headers
janbridley Feb 19, 2025
28c59c8
Increment version
janbridley Feb 19, 2025
9f9e11b
Add contributoragreement
janbridley Feb 19, 2025
16fb75a
Link to Contributor Agreement in development.rst
janbridley Feb 19, 2025
d69ad04
Fix typo
janbridley Feb 19, 2025
58e9a66
Fix package links in README.rst
janbridley Feb 19, 2025
236702c
Swap image to use link
janbridley Feb 19, 2025
0b2adab
Only run testPyPi on labeled PRs
janbridley Feb 19, 2025
314478e
Run on labeled PRs
janbridley Feb 19, 2025
3e5893e
Remove temp.py
janbridley Feb 19, 2025
0fb8e77
Fix label logic
janbridley Feb 19, 2025
8ce972d
Skip-existing for testpypi
janbridley Feb 19, 2025
d5da951
Remove unused label
janbridley Feb 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/pypi-test-and-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and Publish

on:
push:
tags:
- "v*"
branches:
- "main"
- "breaking"
pull_request:

jobs:
build:
name: Build Distribution
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
with:
persist-credentials: false
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.x"

- name: Install pypa/build
run: python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/[email protected]
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish to TestPyPI
needs: [build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/parsnip-cif
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/[email protected]
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
skip-existing: true

publish-to-pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/parsnip-cif
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/[email protected]
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/[email protected]
23 changes: 0 additions & 23 deletions .github/workflows/requirements.yaml

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 @@
BSD 3-Clause License

Copyright (c) 2024, Glotzer Group
Copyright (c) 2025, The Regents of the University of Michigan

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.. _images:

.. image:: doc/source/_static/parsnip_header_dark.svg
.. image:: https://raw.githubusercontent.com/glotzerlab/parsnip/refs/heads/main/doc/source/_static/parsnip_header_dark.svg
:width: 600


Expand Down Expand Up @@ -28,10 +28,14 @@
.. _parse:

Importing ``parsnip`` allows users to read `CIF 1.1 <https://www.iucr.org/resources/cif/spec/version1.1>`_ files, as well as many features from the `CIF 2.0 <https://www.iucr.org/resources/cif/cif2>`_ and `mmCIF <https://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/beginner’s-guide-to-pdb-structures-and-the-pdbx-mmcif-format>`_ formats.
Creating a :class:`~.CifFile` object provides easy access to name-value :attr:`~.CifFile.pairs`, as well
as `loop\_`-delimited :attr:`~.CifFile.tables`. Data entries can be extracted as python primitives or
Creating a `CifFile`_ object provides easy access to name-value `pairs`_, as well
as `loop\_`-delimited `loops`_. Data entries can be extracted as python primitives or
numpy arrays for further use.

.. _CifFile: https://parsnip-cif.readthedocs.io/en/latest/package-parse.html#parsnip.parsnip.CifFile
.. _pairs: https://parsnip-cif.readthedocs.io/en/latest/package-parse.html#parsnip.parsnip.CifFile.pairs
.. _loops: https://parsnip-cif.readthedocs.io/en/latest/package-parse.html#parsnip.parsnip.CifFile.loops

.. _installing:

Setup
Expand All @@ -45,14 +49,14 @@ Installation via pip

.. code:: bash

python -m pip install parsnip
python -m pip install parsnip-cif

Installation via conda-forge
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: bash

conda install -c conda-forge parsnip
conda install -c conda-forge parsnip-cif


Installation from source
Expand Down
2 changes: 1 addition & 1 deletion changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
The format is based on `Keep a Changelog <http://keepachangelog.com/en/1.1.0/>`__.
This project adheres to `Semantic Versioning <http://semver.org/spec/v2.0.0.html>`__.

v1.0.0 - 20xx-xx-xx
v0.2.0 - 2025-02-19
-------------------

Added
Expand Down
28 changes: 28 additions & 0 deletions contributoragreement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Parsnip Contributor Agreement

These terms apply to your contribution to the Parsnip Open Source Project ("Project") owned or managed by the Regents of the University of Michigan ("Michigan"), and set out the intellectual property rights you grant to Michigan in the contributed materials. If this contribution is on behalf of a company, the term "you" will also mean the company you identify below. If you agree to be bound by these terms, fill in the information requested below and provide your signature.

1. The term "contribution" means any source code, object code, patch, tool, sample, graphic, specification, manual, documentation, or any other material posted or submitted by you to a project.
2. With respect to any worldwide copyrights, or copyright applications and registrations, in your contribution:
* you hereby assign to Michigan joint ownership, and to the extent that such assignment is or becomes invalid, ineffective or unenforceable, you hereby grant to Michigan a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free, unrestricted license to exercise all rights under those copyrights. This includes, at Michigan's option, the right to sublicense these same rights to third parties through multiple levels of sublicensees or other licensing arrangements;
* you agree that both Michigan and you can do all things in relation to your contribution as if each of us were the sole owners, and if one of us makes a derivative work of your contribution, the one who makes the derivative work (or has it made) will be the sole owner of that derivative work;
* you agree that you will not assert any moral rights in your contribution against us, our licensees or transferees;
* you agree that we may register a copyright in your contribution and exercise all ownership rights associated with it; and
* you agree that neither of us has any duty to consult with, obtain the consent of, pay or render an accounting to the other for any use or distribution of your contribution.
3. With respect to any patents you own, or that you can license without payment to any third party, you hereby grant to Michigan a perpetual, irrevocable, non-exclusive, worldwide, no-charge, royalty-free license to:
* make, have made, use, sell, offer to sell, import, and otherwise transfer your contribution in whole or in part, alone or in combination with or included in any product, work or materials arising out of the project to which your contribution was submitted; and
* at Michigan's option, to sublicense these same rights to third parties through multiple levels of sublicensees or other licensing arrangements.
4. Except as set out above, you keep all right, title, and interest in your contribution. The rights that you grant to Michigan under these terms are effective on the date you first submitted a contribution to Michigan, even if your submission took place before the date you sign these terms. Any contribution Michigan makes available under any license will also be made available under a suitable Free Software Foundation or Open Source Initiative approved license.
5. With respect to your contribution, you represent that:
* it is an original work and that you can legally grant the rights set out in these terms;
* it does not to the best of your knowledge violate any third party's copyrights, trademarks, patents, or other intellectual property rights; and
you are authorized to sign this contract on behalf of your company (if identified below).
6. The terms will be governed by the laws of the State of Michigan and applicable U.S. Federal Law. Any choice of law rules will not apply.

**By making contribution, you electronically sign and agree to the terms of the Parsnip Contributor Agreement.**

![by-sa.png](https://licensebuttons.net/l/by-sa/3.0/88x31.png)

Based on the Sun Contributor Agreement - version 1.5.
This document is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License
https://creativecommons.org/licenses/by-sa/3.0/
1 change: 1 addition & 0 deletions doc/source/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ As portability is a primary feature of **parsnip**, tests are run run on Python

.. _NEP 29: https://numpy.org/neps/nep-0029-deprecation_policy.html

Please refer to the `Contributor Agreement <https://github.com/glotzerlab/parsnip/blob/main/contributoragreement.md>`_ for further information.

Style Guidelines
----------------
Expand Down
2 changes: 1 addition & 1 deletion parsnip/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, Glotzer Group
# Copyright (c) 2025, The Regents of the University of Michigan
# This file is from the parsnip project, released under the BSD 3-Clause License.

"""``parsnip``: a package for the simple reading and processing of .cif files."""
Expand Down
2 changes: 1 addition & 1 deletion parsnip/_errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, Glotzer Group
# Copyright (c) 2025, The Regents of the University of Michigan
# This file is from the parsnip project, released under the BSD 3-Clause License.


Expand Down
2 changes: 1 addition & 1 deletion parsnip/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, Glotzer Group
# Copyright (c) 2025, The Regents of the University of Michigan
# This file is from the parsnip project, released under the BSD 3-Clause License.

"""Configure doctest namespace."""
Expand Down
4 changes: 2 additions & 2 deletions parsnip/parsnip.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, Glotzer Group
# Copyright (c) 2025, The Regents of the University of Michigan
# This file is from the parsnip project, released under the BSD 3-Clause License.

r"""An interface for reading `CIF`_ files in Python.
Expand Down Expand Up @@ -557,7 +557,7 @@ def box(self):

Example
-------
This method provides a convinient interface to create box objects.
This method provides a convenient interface to create box objects.

>>> box = cif.box
>>> print(box)
Expand Down
2 changes: 1 addition & 1 deletion parsnip/patterns.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2024, Glotzer Group
# Copyright (c) 2025, The Regents of the University of Michigan
# This file is from the parsnip project, released under the BSD 3-Clause License.

"""Functions and classes to process string data.
Expand Down
14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ requires = ["setuptools","wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "parsnip"
version = "0.1.0"
name = "parsnip-cif"
version = "0.2.0"
requires-python = ">=3.7"
description = "Minimal library for parsing CIF & mmCIF files in Python."
readme = "README.md"
readme = "README.rst"
license = { file = "LICENSE" }
authors = [
{name = "Jen Bradley", email = "[email protected]"},
Expand All @@ -31,6 +31,9 @@ dynamic = ["optional-dependencies"]
Source = "https://github.com/glotzerlab/parsnip"
Issues = "https://github.com/glotzerlab/parsnip/issues"

[tool.setuptools]
packages=["parsnip"]

[tool.setuptools.dynamic]
optional-dependencies = {tests = { file = ["tests/requirements.in"] }, doc = { file = ["doc/requirements.txt"] }}

Expand Down Expand Up @@ -91,3 +94,8 @@ known-first-party = ["parsnip"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"

[tool.coverage.run]
omit = [
"parsnip/coverage.py",
]
74 changes: 0 additions & 74 deletions temp.py

This file was deleted.

Loading