Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.cfg: Fix version reference #3

Merged
merged 1 commit into from
Nov 4, 2023
Merged

setup.cfg: Fix version reference #3

merged 1 commit into from
Nov 4, 2023

Conversation

mkoeppe
Copy link
Collaborator

@mkoeppe mkoeppe commented Nov 3, 2023

This fixes the error on installation:

      ModuleNotFoundError: No module named 'py.src'

@milahu
Copy link
Owner

milahu commented Nov 4, 2023

sorry, i have reverted the merge

the current filesystem layout assumes that the package is installed from the project root
where py.src.gnumake_tokenpool.tokenpool.__version__ should work

if we want a "one subfolder per language" layout
then all language-specific files should be moved
for python, that would be setup.cfg and setup.py

for my taste, the current layout is simpler
because build scripts dont need cd py/ etc

here is a gnumake-tokenpool.nix build script

{ lib
, fetchFromGitHub
, buildPythonPackage
, setuptools
, wheel
}:

buildPythonPackage rec {
  pname = "gnumake-tokenpool";
  version = "0.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "milahu";
    repo = "gnumake-tokenpool";
    rev = "py/${version}";
    hash = "sha256-HFrCHY3BbMIO6lDrOe4WMRYNBmbC8jzcOX/g2+cJYf0=";
  };

  nativeBuildInputs = [
    setuptools
    wheel
  ];

  pythonImportsCheck = [ "gnumake_tokenpool" ];

  meta = with lib; {
    description = "Jobclient and jobserver for the GNU make tokenpool protocol";
    homepage = "https://github.com/milahu/gnumake-tokenpool";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}

this will install

$ ( cd /nix/store/sc0sf35ir7w884v39n7fxlfwr9d77v56-python3.10-gnumake-tokenpool-0.0.2/lib/python3.10/site-packages/gnumake_tokenpool && find . -type f -printf "%P\n" )
__init__.py
jobclient.py
__pycache__/jobclient.cpython-310.opt-1.pyc
__pycache__/jobclient.cpython-310.pyc
__pycache__/__init__.cpython-310.opt-1.pyc
__pycache__/__init__.cpython-310.pyc

@mkoeppe
Copy link
Collaborator Author

mkoeppe commented Nov 4, 2023

the current filesystem layout assumes that the package is installed from the project root

Yes, but pip install . from the project root does not work, with the reported error.

@mkoeppe
Copy link
Collaborator Author

mkoeppe commented Nov 4, 2023

where py.src.gnumake_tokenpool.tokenpool.__version__ should work

Note that your setup.cfg already declares where in the tree to find packages: namely where=py/src.
gnumake_tokenpool.tokenpool.__version__ provides the full module name.

@milahu
Copy link
Owner

milahu commented Nov 4, 2023

pip install . from the project root does not work

aah. i have re-merged ba838b0. sorry 4 noise. thanks!

@mkoeppe
Copy link
Collaborator Author

mkoeppe commented Nov 4, 2023

No worries, thanks!

@mkoeppe
Copy link
Collaborator Author

mkoeppe commented Nov 4, 2023

Would you consider tagging a python release and pushing to PyPI?

@milahu
Copy link
Owner

milahu commented Nov 4, 2023

could you do that if i add you as maintainer here?

im not a big fan of pypi/npm/... so im not familiar with the process

@mkoeppe
Copy link
Collaborator Author

mkoeppe commented Nov 4, 2023

Sure, no problem

@mkoeppe
Copy link
Collaborator Author

mkoeppe commented Nov 4, 2023

@milahu
Copy link
Owner

milahu commented Nov 4, 2023

thanks : )

i have updated py/readme.md

vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 10, 2023
…sm of doctesting

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

This is useful when running our doctester in parallel with other build
steps, or several doctesters in parallel, as happens for example in
`make SAGE_CHECK=yes pypi-wheels`, and more of that after sagemath#35095.

To test:
```
MAKE="make -j14" make SAGE_NUM_THREADS=100 DEBUG_JOBCLIENT=1 ptest
```
This will make the doctester attempt to use 100 workers, but it will
only get tokens for 14 workers from `make`.
`DEBUG_JOBCLIENT=1` shows what's happening.

Upstream PR:
- milahu/gnumake-tokenpool#3 (merged)

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Resolves sagemath#30369
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36640
Reported by: Matthias Köppe
Reviewer(s): Michael Orlitzky
vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 13, 2023
…sm of doctesting

    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes sagemath#1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

This is useful when running our doctester in parallel with other build
steps, or several doctesters in parallel, as happens for example in
`make SAGE_CHECK=yes pypi-wheels`, and more of that after sagemath#35095.

To test:
```
MAKE="make -j14" make SAGE_NUM_THREADS=100 DEBUG_JOBCLIENT=1 ptest
```
This will make the doctester attempt to use 100 workers, but it will
only get tokens for 14 workers from `make`.
`DEBUG_JOBCLIENT=1` shows what's happening.

Upstream PR:
- milahu/gnumake-tokenpool#3 (merged)

<!-- Why is this change required? What problem does it solve? -->
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes sagemath#12345". -->
- Resolves sagemath#30369
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- sagemath#12345: short description why this is a dependency
- sagemath#34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: sagemath#36640
Reported by: Matthias Köppe
Reviewer(s): Michael Orlitzky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants