Skip to content

Commit

Permalink
rename package from pyproject08 to pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSazonov committed Jul 15, 2024
1 parent f59019d commit 6817be3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 29 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ['hatchling']
build-backend = 'hatchling.build'

[project]
name = 'pycrysfml08'
name = 'pycrysfml'
version = '0.1.0'
description = 'Testing packaging PyCrysFML08 from https://code.ill.fr/scientific-software/PyCrysFML08'
authors = [
Expand Down Expand Up @@ -43,5 +43,5 @@ test = [
Homepage = 'https://github.com/easyscience/TEST_PyCrysFML'

[tool.hatch.build.targets.wheel]
packages = ['pycrysfml08_dist/pycrysfml08']
packages = ['dist/pyCFML/pycrysfml'] # NEED FIX: Replace based on scripts.toml?
artifacts = ['*.py', '*.so', '*.so.*', '*.dylib', '*.pyd', '*.dll', '*.txt']
13 changes: 6 additions & 7 deletions scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,8 @@ def build_cfml_modules_obj():
lines.append(cmd)
msg = _echo_msg(f"Building fortran objects for {project_name} modules")
lines.append(msg)
compile_lines = _compile_objs_script_lines('src-cfml-modules', src_path)
compile_lines = _compile_objs_script_lines('src-cfml-modules',
src_path)
lines.extend(compile_lines)
msg = _echo_msg(f"Exiting build dir '{build_dir}'")
lines.append(msg)
Expand Down Expand Up @@ -864,13 +865,11 @@ def build_pycfml_shared_obj_or_dynamic_lib():
_write_lines_to_file(lines, script_name)
append_to_main_script(lines)



def create_pycfml_dist_dir():
dist_dir = CONFIG['pycfml']['dir']['dist']
lib_dist_dir = CONFIG['pycfml']['dir']['dist-lib']
include_dist_dir = CONFIG['pycfml']['dir']['dist-include']
package_dist_dir = CONFIG['pycfml']['dir']['dist-package']
package_dist_dir = CONFIG['pycfml']['dir']['dist-package'].replace('{PACKAGE_NAME}', PYPROJECT['project']['name'])
wheel_dist_dir = CONFIG['pycfml']['dir']['dist-wheel']
lines = []
msg = _echo_msg(f"Deleting dist dir '{dist_dir}'")
Expand Down Expand Up @@ -1128,9 +1127,9 @@ def create_pycfml_python_wheel():

def rename_pycfml_python_wheel():
project_name = CONFIG['pycfml']['log-name']
pycfml_package_name = CONFIG['pycfml']['package-name']
dist_package_name = PYPROJECT['project']['name']
dist_package_version = PYPROJECT['project']['version']
initial_wheel_name = f'{pycfml_package_name}-{dist_package_version}-py3-none-any.whl'
initial_wheel_name = f'{dist_package_name}-{dist_package_version}-py3-none-any.whl'
wheel_dir = CONFIG['pycfml']['dir']['dist-wheel']
wheel_relpath = os.path.join(wheel_dir, initial_wheel_name)
wheel_abspath = os.path.join(_project_path(), wheel_relpath)
Expand All @@ -1148,7 +1147,7 @@ def rename_pycfml_python_wheel():

def install_pycfml_from_wheel():
project_name = CONFIG['pycfml']['log-name']
package_name = CONFIG['pycfml']['package-name']
package_name = PYPROJECT['project']['name']
wheel_dir = CONFIG['pycfml']['dir']['dist-wheel']
wheel_path = os.path.join(_project_path(), wheel_dir)
lines = []
Expand Down
39 changes: 19 additions & 20 deletions scripts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ log-name = 'CFML'
static-lib-name = 'CrysFML08' # without 'lib' prefix on unix-based platforms

[cfml.dir]
repo = 'repo/crysfml'
repo-src = 'repo/crysfml/Src'
repo-tests = 'repo/crysfml/Testing'
repo-database = 'repo/crysfml/Src/Databases/magnetic_data.txt'
build = 'build/crysfml'
build-obj = 'build/crysfml/obj'
dist = 'dist/crysfml' # Fortran CrysFML2008
dist-include = 'dist/crysfml/include' # for .mod/.smod files
dist-lib = 'dist/crysfml/lib' # for static library
repo = 'repo/CFML'
repo-src = 'repo/CFML/Src'
repo-tests = 'repo/CFML/Testing'
repo-database = 'repo/CFML/Src/Databases/magnetic_data.txt'
build = 'build/CFML'
build-obj = 'build/CFML/obj'
dist = 'dist/CFML' # Fortran CrysFML2008
dist-include = 'dist/CFML/include' # for .mod/.smod files
dist-lib = 'dist/CFML/lib' # for static library

[cfml.git]
url = 'https://code.ill.fr/scientific-software/crysfml2008.git'
branch = 'powder_mod_fix'

[cfml.scripts]
pyapigen = 'repo/crysfml/Scripts/PythonAPI/apigen.py'
pyapigen = 'repo/CFML/Scripts/PythonAPI/apigen.py'

#############################################
# Python API for CrysFML Fortran 2008 Library
Expand All @@ -32,18 +32,17 @@ pyapigen = 'repo/crysfml/Scripts/PythonAPI/apigen.py'
log-name = 'pyCFML'
src-name = 'crysfml08lib'
dynamic-lib-name = 'crysfml08lib' # NEED FIX: currently not in use in scripts.py
package-name = 'pycrysfml08'

[pycfml.dir]
build-src = 'build/pycrysfml/src' # content will be generated by apigen.py
build-src-fortran = 'build/pycrysfml/src/Fortran'
build-src-python = 'build/pycrysfml/src/Python_API'
build-obj = 'build/pycrysfml/obj'
dist = 'dist/pycrysfml' # Python API to Fortran CrysFML2008
dist-include = 'dist/pycrysfml/include' # for .mod/.smod files
dist-lib = 'dist/pycrysfml/lib' # for static object or dynamic library
dist-package = 'dist/pycrysfml/pycrysfml08' # for Python package
dist-wheel = 'dist/pycrysfml/wheel' # for Python wheel
build-src = 'build/pyCFML/src' # content will be generated by apigen.py
build-src-fortran = 'build/pyCFML/src/Fortran'
build-src-python = 'build/pyCFML/src/Python_API'
build-obj = 'build/pyCFML/obj'
dist = 'dist/pyCFML' # Python API to Fortran CrysFML2008
dist-include = 'dist/pyCFML/include' # for .mod/.smod files
dist-lib = 'dist/pyCFML/lib' # for static object or dynamic library
dist-package = 'dist/pyCFML/{PACKAGE_NAME}' # for Python package
dist-wheel = 'dist/pyCFML/wheel' # for Python wheel

########################################################
# Generic build template commands and related parameters
Expand Down

0 comments on commit 6817be3

Please sign in to comment.