Skip to content

Commit f36ef0b

Browse files
authored
Merge pull request #52 from astro-informatics/feature/conan-center-index
feature/conan-center-index
2 parents bafae6b + 890f0fc commit f36ef0b

21 files changed

+559
-292
lines changed

.cmake-format.yaml

Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
_help_parse: Options affecting listfile parsing
2+
parse:
3+
_help_additional_commands:
4+
- Specify structure for custom cmake functions
5+
additional_commands:
6+
foo:
7+
flags:
8+
- BAR
9+
- BAZ
10+
kwargs:
11+
HEADERS: "*"
12+
SOURCES: "*"
13+
DEPENDS: "*"
14+
_help_override_spec:
15+
- Override configurations per-command where available
16+
override_spec: {}
17+
_help_vartags:
18+
- Specify variable tags.
19+
vartags: []
20+
_help_proptags:
21+
- Specify property tags.
22+
proptags: []
23+
_help_format: Options affecting formatting.
24+
format:
25+
_help_disable:
26+
- Disable formatting entirely, making cmake-format a no-op
27+
disable: false
28+
_help_line_width:
29+
- How wide to allow formatted cmake files
30+
line_width: 88
31+
_help_tab_size:
32+
- How many spaces to tab for indent
33+
tab_size: 4
34+
_help_use_tabchars:
35+
- If true, lines are indented using tab characters (utf-8
36+
- 0x09) instead of <tab_size> space characters (utf-8 0x20).
37+
- In cases where the layout would require a fractional tab
38+
- character, the behavior of the fractional indentation is
39+
- governed by <fractional_tab_policy>
40+
use_tabchars: false
41+
_help_fractional_tab_policy:
42+
- If <use_tabchars> is True, then the value of this variable
43+
- indicates how fractional indentions are handled during
44+
- whitespace replacement. If set to 'use-space', fractional
45+
- indentation is left as spaces (utf-8 0x20). If set to
46+
- "`round-up` fractional indentation is replaced with a single"
47+
- tab character (utf-8 0x09) effectively shifting the column
48+
- to the next tabstop
49+
fractional_tab_policy: use-space
50+
_help_max_subgroups_hwrap:
51+
- If an argument group contains more than this many sub-groups
52+
- (parg or kwarg groups) then force it to a vertical layout.
53+
max_subgroups_hwrap: 2
54+
_help_max_pargs_hwrap:
55+
- If a positional argument group contains more than this many
56+
- arguments, then force it to a vertical layout.
57+
max_pargs_hwrap: 6
58+
_help_max_rows_cmdline:
59+
- If a cmdline positional group consumes more than this many
60+
- lines without nesting, then invalidate the layout (and nest)
61+
max_rows_cmdline: 2
62+
_help_separate_ctrl_name_with_space:
63+
- If true, separate flow control names from their parentheses
64+
- with a space
65+
separate_ctrl_name_with_space: false
66+
_help_separate_fn_name_with_space:
67+
- If true, separate function names from parentheses with a
68+
- space
69+
separate_fn_name_with_space: false
70+
_help_dangle_parens:
71+
- If a statement is wrapped to more than one line, than dangle
72+
- the closing parenthesis on its own line.
73+
dangle_parens: false
74+
_help_dangle_align:
75+
- If the trailing parenthesis must be 'dangled' on its on
76+
- "line, then align it to this reference: `prefix`: the start"
77+
- "of the statement, `prefix-indent`: the start of the"
78+
- "statement, plus one indentation level, `child`: align to"
79+
- the column of the arguments
80+
dangle_align: child
81+
_help_min_prefix_chars:
82+
- If the statement spelling length (including space and
83+
- parenthesis) is smaller than this amount, then force reject
84+
- nested layouts.
85+
min_prefix_chars: 4
86+
_help_max_prefix_chars:
87+
- If the statement spelling length (including space and
88+
- parenthesis) is larger than the tab width by more than this
89+
- amount, then force reject un-nested layouts.
90+
max_prefix_chars: 10
91+
_help_max_lines_hwrap:
92+
- If a candidate layout is wrapped horizontally but it exceeds
93+
- this many lines, then reject the layout.
94+
max_lines_hwrap: 2
95+
_help_line_ending:
96+
- What style line endings to use in the output.
97+
line_ending: unix
98+
_help_command_case:
99+
- Format command names consistently as 'lower' or 'upper' case
100+
command_case: canonical
101+
_help_keyword_case:
102+
- Format keywords consistently as 'lower' or 'upper' case
103+
keyword_case: unchanged
104+
_help_always_wrap:
105+
- A list of command names which should always be wrapped
106+
always_wrap: []
107+
_help_enable_sort:
108+
- If true, the argument lists which are known to be sortable
109+
- will be sorted lexicographicall
110+
enable_sort: true
111+
_help_autosort:
112+
- If true, the parsers may infer whether or not an argument
113+
- list is sortable (without annotation).
114+
autosort: false
115+
_help_require_valid_layout:
116+
- By default, if cmake-format cannot successfully fit
117+
- everything into the desired linewidth it will apply the
118+
- last, most agressive attempt that it made. If this flag is
119+
- True, however, cmake-format will print error, exit with non-
120+
- zero status code, and write-out nothing
121+
require_valid_layout: false
122+
_help_layout_passes:
123+
- A dictionary mapping layout nodes to a list of wrap
124+
- decisions. See the documentation for more information.
125+
layout_passes: {}
126+
_help_markup: Options affecting comment reflow and formatting.
127+
markup:
128+
_help_bullet_char:
129+
- What character to use for bulleted lists
130+
bullet_char: "*"
131+
_help_enum_char:
132+
- What character to use as punctuation after numerals in an
133+
- enumerated list
134+
enum_char: .
135+
_help_first_comment_is_literal:
136+
- If comment markup is enabled, don't reflow the first comment
137+
- block in each listfile. Use this to preserve formatting of
138+
- your copyright/license statements.
139+
first_comment_is_literal: false
140+
_help_literal_comment_pattern:
141+
- If comment markup is enabled, don't reflow any comment block
142+
- which matches this (regex) pattern. Default is `None`
143+
- (disabled).
144+
literal_comment_pattern: null
145+
_help_fence_pattern:
146+
- Regular expression to match preformat fences in comments
147+
- default= ``r'^\s*([`~]{3}[`~]*)(.*)$'``
148+
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$
149+
_help_ruler_pattern:
150+
- Regular expression to match rulers in comments default=
151+
- '``r''^\s*[^\w\s]{3}.*[^\w\s]{3}$''``'
152+
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$
153+
_help_explicit_trailing_pattern:
154+
- If a comment line matches starts with this pattern then it
155+
- is explicitly a trailing comment for the preceeding
156+
- argument. Default is '#<'
157+
explicit_trailing_pattern: "#<"
158+
_help_hashruler_min_length:
159+
- If a comment line starts with at least this many consecutive
160+
- hash characters, then don't lstrip() them off. This allows
161+
- for lazy hash rulers where the first hash char is not
162+
- separated by space
163+
hashruler_min_length: 10
164+
_help_canonicalize_hashrulers:
165+
- If true, then insert a space between the first hash char and
166+
- remaining hash chars in a hash ruler, and normalize its
167+
- length to fill the column
168+
canonicalize_hashrulers: true
169+
_help_enable_markup:
170+
- enable comment markup parsing and reflow
171+
enable_markup: true
172+
_help_lint: Options affecting the linter
173+
lint:
174+
_help_disabled_codes:
175+
- a list of lint codes to disable
176+
disabled_codes: []
177+
_help_function_pattern:
178+
- regular expression pattern describing valid function names
179+
function_pattern: "[0-9a-z_]+"
180+
_help_macro_pattern:
181+
- regular expression pattern describing valid macro names
182+
macro_pattern: "[0-9A-Z_]+"
183+
_help_global_var_pattern:
184+
- regular expression pattern describing valid names for
185+
- variables with global (cache) scope
186+
global_var_pattern: "[A-Z][0-9A-Z_]+"
187+
_help_internal_var_pattern:
188+
- regular expression pattern describing valid names for
189+
- variables with global scope (but internal semantic)
190+
internal_var_pattern: _[A-Z][0-9A-Z_]+
191+
_help_local_var_pattern:
192+
- regular expression pattern describing valid names for
193+
- variables with local scope
194+
local_var_pattern: "[a-z][a-z0-9_]+"
195+
_help_private_var_pattern:
196+
- regular expression pattern describing valid names for
197+
- privatedirectory variables
198+
private_var_pattern: _[0-9a-z_]+
199+
_help_public_var_pattern:
200+
- regular expression pattern describing valid names for public
201+
- directory variables
202+
public_var_pattern: "[A-Z][0-9A-Z_]+"
203+
_help_argument_var_pattern:
204+
- regular expression pattern describing valid names for
205+
- function/macro arguments and loop variables.
206+
argument_var_pattern: "[a-z][a-z0-9_]+"
207+
_help_keyword_pattern:
208+
- regular expression pattern describing valid names for
209+
- keywords used in functions or macros
210+
keyword_pattern: "[A-Z][0-9A-Z_]+"
211+
_help_max_conditionals_custom_parser:
212+
- In the heuristic for C0201, how many conditionals to match
213+
- within a loop in before considering the loop a parser.
214+
max_conditionals_custom_parser: 2
215+
_help_min_statement_spacing:
216+
- Require at least this many newlines between statements
217+
min_statement_spacing: 1
218+
_help_max_statement_spacing:
219+
- Require no more than this many newlines between statements
220+
max_statement_spacing: 2
221+
max_returns: 6
222+
max_branches: 12
223+
max_arguments: 5
224+
max_localvars: 15
225+
max_statements: 50
226+
_help_encode: Options affecting file encoding
227+
encode:
228+
_help_emit_byteorder_mark:
229+
- If true, emit the unicode byte-order mark (BOM) at the start
230+
- of the file
231+
emit_byteorder_mark: false
232+
_help_input_encoding:
233+
- Specify the encoding of the input file. Defaults to utf-8
234+
input_encoding: utf-8
235+
_help_output_encoding:
236+
- Specify the encoding of the output file. Defaults to utf-8.
237+
- Note that cmake only claims to support utf-8 so be careful
238+
- when using anything else
239+
output_encoding: utf-8
240+
_help_misc: Miscellaneous configurations options.
241+
misc:
242+
_help_per_command:
243+
- A dictionary containing any per-command configuration
244+
- overrides. Currently only `command_case` is supported.
245+
per_command: {}

.github/workflows/python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ jobs:
118118
mv source-distribution/*.tar.gz wheel-*/*.whl dist
119119
120120
- name: Publish distribution 📦 to Test PyPI
121-
if: ${{ github.ref != 'refs/tags/v1.3.6' }}
121+
if: ${{ github.ref != 'refs/tags/v1.3.7' }}
122122
uses: pypa/gh-action-pypi-publish@master
123123
with:
124124
password: ${{ secrets.TEST_PYPI_TOKEN }}
125125
repository_url: https://test.pypi.org/legacy/
126126

127127
- name: Publish distribution 📦 to PyPI
128-
if: ${{ github.ref == 'refs/tags/v1.3.6' }}
128+
if: ${{ github.ref == 'refs/tags/v1.3.7' }}
129129
uses: pypa/gh-action-pypi-publish@master
130130
with:
131131
password: ${{ secrets.PYPI_TOKEN }}

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ repos:
1313
hooks:
1414
- id: prettier
1515
files: '.+\.yaml'
16+
- repo: https://github.com/cheshirekow/cmake-format-precommit
17+
rev: v0.6.10
18+
hooks:
19+
- id: cmake-format
20+
- id: cmake-lint

CMakeLists.txt

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,59 @@
11
cmake_minimum_required(VERSION 3.12)
22

33
project(
4-
Ssht
5-
VERSION "1.3.6"
6-
DESCRIPTION "Fast and exact spin spherical harmonic transforms"
7-
HOMEPAGE_URL "http://astro-informatics.github.io/ssht/"
8-
LANGUAGES C)
4+
Ssht
5+
VERSION "1.3.7"
6+
DESCRIPTION "Fast and exact spin spherical harmonic transforms"
7+
HOMEPAGE_URL "http://astro-informatics.github.io/ssht/"
8+
LANGUAGES C)
99

1010
option(tests "Enable testing" ON)
1111
option(conan_deps "Download dependencies using conan" OFF)
1212
if(NOT WIN32)
13-
option(fPIC "Compile with fPIC" ON)
13+
option(fPIC "Compile with fPIC" ON)
1414
endif()
1515

16-
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
17-
1816
if(NOT CMAKE_BUILD_TYPE)
19-
set(CMAKE_BUILD_TYPE Debug)
17+
set(CMAKE_BUILD_TYPE Debug)
2018
endif()
2119
if(tests)
22-
enable_testing()
20+
enable_testing()
2321
endif()
2422
if(conan_deps OR CONAN_EDITABLE_MODE)
25-
include("conan_dependencies")
26-
set(FFTW3_TARGET CONAN_PKG::fftw)
23+
include("${PROJECT_SOURCE_DIR}/cmake/conan_dependencies.cmake")
24+
endif()
25+
if(EXISTS "${PROJECT_BINARY_DIR}/conan_paths.cmake")
26+
include("${PROJECT_BINARY_DIR}/conan_paths.cmake")
27+
elseif(EXISTS "${PROJECT_BINARY_DIR}/FindFFTW3.cmake")
28+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_BINARY_DIR}")
2729
else()
28-
find_package(FFTW3 REQUIRED COMPONENTS SERIAL DOUBLE)
29-
set(FFTW3_TARGET fftw3)
30+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
3031
endif()
32+
find_package(FFTW3 REQUIRED)
33+
find_library(MATH_LIBRARY m)
3134

3235
add_subdirectory(src/c)
3336
if(tests)
34-
include("fetch_cmocka")
35-
add_subdirectory(tests)
37+
include("${PROJECT_SOURCE_DIR}/cmake/fetch_cmocka.cmake")
38+
add_subdirectory(tests)
3639
endif()
3740

38-
if(NOT SKBUILD)
39-
include("exporting")
40-
else()
41-
find_package(PythonExtensions REQUIRED)
42-
find_package(Cython REQUIRED)
43-
find_package(NumPy REQUIRED)
44-
add_subdirectory(src/pyssht)
41+
if(NOT SKBUILD AND NOT CONAN_EXPORTED)
42+
include("${PROJECT_SOURCE_DIR}/cmake/exporting.cmake")
43+
elseif(NOT CONAN_EXPORTED)
44+
find_package(PythonExtensions REQUIRED)
45+
find_package(Cython REQUIRED)
46+
find_package(NumPy REQUIRED)
47+
add_subdirectory(src/pyssht)
4548
endif()
4649

4750
# only run documentation if this is not a sub-project
4851
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
49-
find_package(Doxygen)
50-
if(DOXYGEN_FOUND)
51-
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C "YES")
52-
set(DOXYGEN_EXTRACT_ALL "YES")
53-
set(DOXYGEN_FILE_PATTERNS *.h *.c)
54-
doxygen_add_docs(docs src/c include tests)
55-
endif()
52+
find_package(Doxygen)
53+
if(DOXYGEN_FOUND)
54+
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C "YES")
55+
set(DOXYGEN_EXTRACT_ALL "YES")
56+
set(DOXYGEN_FILE_PATTERNS *.h *.c)
57+
doxygen_add_docs(docs src/c include tests)
58+
endif()
5659
endif()

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include CMakeLists.txt
22
include setup.py setup.cfg pyproject.toml
33
include COPYRIGHT.txt LICENSE.md README.md
44
include cmake/*.cmake
5+
include conanfile.txt
56
recursive-include src/c *.c CMakeLists.txt
67
recursive-include include/ssht *.h CMakeLists.txt
78
recursive-include src/pyssht .py *.pyx *.md CMakeLists.txt

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
[docs-img]: https://img.shields.io/badge/docs-stable-blue.svg
44
[docs-url]: https://astro-informatics.github.io/ssht/
5-
[bintray-img]: https://img.shields.io/badge/ConanCenter-C%20Package-red.svg
6-
[bintray-url]: https://conan.io/center/ssht
5+
[conan-img]: https://img.shields.io/badge/ConanCenter-C%20Package-red.svg
6+
[conan-url]: https://conan.io/center/ssht
77
[pypi-img]: https://badge.fury.io/py/pyssht.svg
88
[pypi-url]: https://badge.fury.io/py/pyssht
99
[codefactor-img]: https://www.codefactor.io/repository/github/astro-informatics/ssht/badge/main
1010
[codefactor-url]: https://www.codefactor.io/repository/github/astro-informatics/ssht/overview/main
1111

1212
[![][docs-img]][docs-url]
13-
[![][bintray-img]][bintray-url]
13+
[![][conan-img]][conan-url]
1414
[![][pypi-img]][pypi-url]
1515
[![][codefactor-img]][codefactor-url]
1616
![CMake Build](https://github.com/astro-informatics/ssht/workflows/CMake%20Build/badge.svg)

0 commit comments

Comments
 (0)