Skip to content

Commit

Permalink
Change dir structure
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimes committed Jan 6, 2024
1 parent caf404e commit a8ff289
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/mmh3/_mmh3/smhasher"]
path = src/mmh3/_mmh3/smhasher
path = util/smhasher
url = https://github.com/aappleby/smhasher.git
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ include src/mmh3/*.c
include src/mmh3/*.h
include src/mmh3/*.pyi
include src/mmh3/py.typed
include src/mmh3/_mmh3/*
include README.md
include LICENSE
include CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import Extension, setup

mmh3module = Extension(
"mmh3", sources=["./src/mmh3/mmh3module.c", "./src/mmh3/_mmh3/murmurhash3.c"]
"mmh3", sources=["./src/mmh3/mmh3module.c", "./src/mmh3/murmurhash3.c"]
)

setup(
Expand Down
2 changes: 1 addition & 1 deletion src/mmh3/mmh3module.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <byteswap.h>
#endif

#include "_mmh3/murmurhash3.h"
#include "murmurhash3.h"
#include "hashlib.h"

#if defined(_MSC_VER)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/mmh3/_mmh3/README.md → util/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This directory contains C files that were generated from the

## Updating _mmh3

Use the `refresh.py` script in this directory to generate PEP 7-compliant C code from Appleby's original SMHasher project, instead of editing `_mmh3` files manually. Add transformation code to the `refresh.py` script to perform further edits.
Use the `refresh.py` script **within this directory** to generate PEP 7-compliant C code from Appleby's original SMHasher project, instead of editing `_mmh3` files manually. Add transformation code to the `refresh.py` script to perform further edits.

After file generation, use `clang-format` (with `.clang-format` in the top directory of the `mmh3` project) to format the generated code.

Expand All @@ -17,5 +17,5 @@ After file generation, use `clang-format` (with `.clang-format` in the top direc

## Generated files

1. `./murmurhash3.c`
1. `./murmurhash3.h`
1. `../src/mmh3/murmurhash3.c`
1. `../src/mmh3/murmurhash3.h`
4 changes: 2 additions & 2 deletions src/mmh3/_mmh3/refresh.py → util/refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,8 @@ def lowercase_function_names(subcode: str) -> str:
new_header_name = "murmurhash3.h"
file_header_name = "FILE_HEADER"

new_source_path = os.path.join(dir_path, new_source_name)
new_header_path = os.path.join(dir_path, new_header_name)
new_source_path = os.path.join(dir_path, "../src/mmh3", new_source_name)
new_header_path = os.path.join(dir_path, "../src/mmh3", new_header_name)
file_header_path = os.path.join(dir_path, file_header_name)

with open(original_source_path, "r") as source_file, open(
Expand Down

0 comments on commit a8ff289

Please sign in to comment.