Skip to content

Commit 4179ea8

Browse files
committed
sync with working tree in the easyScience repo
1 parent e0e275e commit 4179ea8

File tree

7 files changed

+38
-94
lines changed

7 files changed

+38
-94
lines changed

.github/workflows/build.yaml

+30-69
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
# strategy:
8-
# max-parallel: 4
9-
# matrix:
10-
# python-version: ['3.8', '3.9', '3.10']
11-
# os: [ubuntu-latest, macos-latest, windows-latest]
7+
strategy:
8+
max-parallel: 4
9+
matrix:
10+
python-version: ['3.8', '3.9', '3.10']
11+
os: [ubuntu-latest, macos-latest, windows-latest]
1212

13-
# runs-on: ${{ matrix.os }}
14-
runs-on: windows-latest
13+
runs-on: ${{ matrix.os }}
1514
steps:
1615
- name: Check-out repository
1716
uses: actions/checkout@v2
@@ -20,8 +19,7 @@ jobs:
2019
uses: s-weigand/setup-conda@v1
2120
with:
2221
update-conda: true
23-
# python-version: ${{ matrix.python-version }}
24-
python-version: '3.8'
22+
python-version: ${{ matrix.python-version }}
2523

2624
- name: Install dependencies
2725
run: |
@@ -31,70 +29,33 @@ jobs:
3129
conda install -c conda-forge pip
3230
conda install -c conda-forge gsl
3331
34-
- name: Build package
32+
- name: Build wheels
3533
run: |
3634
python setup.py sdist bdist_wheel
37-
ls -l ${{ github.workspace }}
38-
ls -l ${{ github.workspace }}/dist
39-
ls -l ${{ github.workspace }}/build
4035
41-
upload:
42-
needs: build
43-
runs-on: ubuntu-latest
44-
steps:
45-
46-
- name: show content
36+
- name: Run tests
4737
run: |
48-
ls -l ${{ github.workspace }}/../
49-
ls -l ${{ github.workspace }}/../dist
38+
conda install -c conda-forge numpy
39+
python setup.py install
40+
python conda-recipe/run_test.py
5041
51-
- uses: actions/upload-artifact@v2
42+
- name: Upload Artifacts GitHub releases
43+
uses: ncipollo/release-action@v1
5244
with:
53-
name: diffpy2 - Python ${{ matrix.python-version }}
54-
path: ${{ github.workspace }}/dist/*.whl
55-
56-
# - name: Upload zipped offline app installer to GitHub releases
57-
# uses: ncipollo/release-action@v1
45+
draft: false
46+
prerelease: true
47+
allowUpdates: true
48+
replacesArtifacts: true
49+
token: ${{ secrets.GITHUB_TOKEN }}
50+
artifacts: ${{ github.workspace }}/dist/*.whl
51+
tag: 1.4.0
52+
body: This is an alpha build of the pdffit2 library (1.4.0)
53+
54+
# This step will upload tagged commits to pypi.
55+
# The pypi token must be added to GH secrets
56+
#
57+
# - name: Publish package
58+
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
59+
# uses: pypa/gh-action-pypi-publish@release/v1
5860
# with:
59-
# draft: true
60-
# prerelease: true
61-
# allowUpdates: true
62-
# replacesArtifacts: true
63-
# token: ${{ secrets.GITHUB_TOKEN }}
64-
# artifacts: dist/*.whl
65-
# tag: 1.4.1
66-
# body: This is an alpha build of diffpy2
67-
68-
69-
# upload:
70-
# steps:
71-
# - name: Checkout target repo
72-
# uses: actions/checkout@v3
73-
# env:
74-
# REPO: easyScience/pypi
75-
# REPO_PATH: pypi
76-
# with:
77-
# fetch-depth: 0
78-
# token: ${{ secrets.ES_TOKEN }}
79-
# repository: ${{ env.REPO }}
80-
# path: ${{ env.REPO_PATH }}
81-
82-
# - name: Copy index to new repo
83-
# env:
84-
# SOURCE: index.html
85-
# TARGET: pypi/easysciencecore/
86-
# run: cp ${{ env.SOURCE }} ${{ env.TARGET }}
87-
# - name: Push
88-
# env:
89-
# REPO_PATH: pypi
90-
# GIT_USERNAME: action
91-
# GIT_EMAIL: [email protected]
92-
# run: |
93-
# cd ${{ env.REPO_PATH }}
94-
# git config --local user.name "${{ env.GIT_USERNAME }}"
95-
# git config --local user.email "${{ env.GIT_EMAIL }}"
96-
# git add .
97-
# if [[ `git status --porcelain` ]]; then
98-
# git commit -m "Github Actions Automatically Built in `date +"%Y-%m-%d %H:%M"`"
99-
# git push
100-
# fi
61+
# password: ${{ secrets.PYPI_API_TOKEN }}

pdffit2module/PyFileStreambuf.h

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#ifndef PYFILESTREAMBUF_H_INCLUDED
2727
#define PYFILESTREAMBUF_H_INCLUDED
28+
#define PY_SSIZE_T_CLEAN
2829

2930
#include <Python.h>
3031
#include <streambuf>

pdffit2module/bindings.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Comments:
1818
*
1919
***********************************************************************/
20-
20+
#define PY_SSIZE_T_CLEAN
2121
#include <Python.h>
2222

2323
#include "bindings.h"

pdffit2module/misc.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Comments:
1818
*
1919
***********************************************************************/
20-
20+
#define PY_SSIZE_T_CLEAN
2121
#include <Python.h>
2222
#include <vector>
2323
#include <string>

pdffit2module/pdffit2module.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Comments:
1818
*
1919
***********************************************************************/
20-
20+
#define PY_SSIZE_T_CLEAN
2121
#include <Python.h>
2222
#include <ostream>
2323

pdffit2module/pyexceptions.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* Comments:
1818
*
1919
***********************************************************************/
20-
20+
#define PY_SSIZE_T_CLEAN
2121
#include <Python.h>
2222

2323
PyObject *pypdffit2_runtimeError = 0;

setup.py

+3-21
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@
3131

3232

3333
def gitinfo():
34-
from subprocess import Popen, PIPE
34+
from subprocess import Popen, PIPE, check_output
3535
kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True)
3636
proc = Popen(['git', 'describe', '--tags', '--match=v[[:digit:]]*'], **kw)
3737
desc = proc.stdout.read()
3838
proc = Popen(['git', 'log', '-1', '--format=%H %ct %ci'], **kw)
3939
glog = proc.stdout.read()
4040
rv = {}
41-
rv['version'] = '.post'.join(desc.strip().split('-')[:2]).lstrip('v')
4241
rv['commit'], rv['timestamp'], rv['date'] = glog.strip().split(None, 2)
42+
version = check_output(['git', 'tag']).decode('ascii').strip()
43+
rv['version'] = version
4344
return rv
4445

4546

@@ -163,25 +164,6 @@ def get_gsl_config_win():
163164
library_dirs += gcfg['library_dirs']
164165
# add optimization flags for other compilers if needed
165166

166-
# print("INCLUDE DIR = {!r}".format(include_dirs))
167-
# print("LIBRARY DIR = {!r}".format(library_dirs))
168-
# import glob
169-
170-
# pattern = 'gsl*.*'
171-
172-
# library_dir = library_dirs[0]
173-
# matching_files = glob.glob(library_dir + '/' + pattern)
174-
# if len(matching_files) != 0:
175-
# print("GSL LIBRARY FOUND in {!r}".format(matching_files[0]))
176-
177-
# print("----- CONDA -----")
178-
# library_dir = "C:\\Miniconda"
179-
# matching_files = glob.glob(library_dir + '\\' + pattern)
180-
# if len(matching_files) != 0:
181-
# for f in matching_files:
182-
# print(f)
183-
# # print("GSL LIBRARY FOUND in {!r}".format(matching_files[0]))
184-
# print("----- CONDA END -----")
185167

186168
# define extension here
187169
pdffit2module = Extension('diffpy.pdffit2.pdffit2', [

0 commit comments

Comments
 (0)