Skip to content

Commit

Permalink
github action for releasing sdist on pypi (#9)
Browse files Browse the repository at this point in the history
* Fix lint

* Add pipeline to release sdist on pypi

* Missing C files (issue #8)

* Update CI job configuration

* flake8 configuration
  • Loading branch information
sunqm authored Dec 19, 2023
1 parent c00ac4a commit 215ac25
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 16 deletions.
6 changes: 3 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[flake8]
# https://flake8.pycqa.org/en/2.5.5/warnings.html#error-codes
ignore = E127, E129, E201, E202, E203, E225, E226, E231, E241, E261, E262, \
E265, E266, E301, E302, E303, E305, E401, E701, W391, W504, C901, \
F401, E228, E126, W503, E731, E211, E221, E222, E741, E251, E402, \
ignore = E127, E129, E201, E202, E203, E225, E226, E231, E241, E261, E262,
E265, E266, E301, E302, E303, E305, E401, E701, W391, W504, C901,
F401, E228, E126, W503, E731, E211, E221, E222, E741, E251, E402,
E306

exclude = test, .git, __pycache__, build, dist, __init__.py .eggs, *.egg
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
python-version: [3.8]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: 3.9
- uses: actions/checkout@v2
- name: Install and Test
run: |
set -ex
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on: [push, pull_request]

jobs:
flake:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.9
- uses: actions/checkout@v2
- name: Install flake8
run: pip install "flake8>=3.7.0"
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish

on:
release:
types:
# Note: editing the prerelease then marking as release does not trigger
# this pipeline
# - prereleased
- released
workflow_dispatch:

jobs:
release-pypi-sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: |
python3 setup.py sdist
- name: List available sdist
run: |
ls ${{ github.workspace }}/dist
- name: Publish to PyPI
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
#password: ${{ secrets.PYPI_TEST_API_TOKEN }}
#repository_url: https://test.pypi.org/legacy/
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: ${{ github.workspace }}/dist
verbose: true
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ include README.md setup.py CHANGELOG LICENSE
prune pyscf/lib/build pyscf/build

recursive-include pyscf *.dat *.so *.dylib
recursive-exclude pyscf *.c *.h
4 changes: 2 additions & 2 deletions pyscf/semiempirical/mindo3.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@lib.with_doc(scf.hf.get_hcore.__doc__)
def get_hcore(mol):
assert(not mol.has_ecp())
assert not mol.has_ecp()
nao = mol.nao

atom_charges = mol.atom_charges()
Expand Down Expand Up @@ -313,7 +313,7 @@ def nuc_grad_method(self):


def _make_mindo_mol(mol):
assert(not mol.has_ecp())
assert not mol.has_ecp()
def make_sto_6g(n, l, zeta):
es = mopac_param.gexps[(n, l)]
cs = mopac_param.gcoefs[(n, l)]
Expand Down

0 comments on commit 215ac25

Please sign in to comment.