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

Update of the build process #659

Merged
merged 4 commits into from
Oct 5, 2023
Merged

Update of the build process #659

merged 4 commits into from
Oct 5, 2023

Conversation

lfarv
Copy link
Contributor

@lfarv lfarv commented Sep 21, 2023

Main changes:

  • the numpy dependencies are simplified in pyproject.toml by using the package oldest-supported-numpy which selects for each python version, platform and architecture the correct numpy version used for compilation.
  • As a consequence, the substitution githubproject.toml -> pyproject.toml used in building wheels is no more necessary, which makes building wheels simpler
  • A few GitHub actions have been updated to new versions, avoiding the warnings like "The following actions uses node12 which is deprecated and will be forced to run on node16…"

The production of documentation and wheels has been tested.

@lfarv lfarv added enhancement Python For python AT code labels Sep 21, 2023
@swhite2401
Copy link
Contributor

Hello, since we are looking at the build I have noticed that pip requires internet access to build and install AT. Do you know any workaround? This would be very useful if it exists

@lfarv
Copy link
Contributor Author

lfarv commented Sep 22, 2023

@swhite2401:
When building from source, pip works in a separate environment. That means that pip has to fill an empty environment with the build dependencies (setuptools, numpy and wheels). On the 1st build, it will download them. On the next runs, pip maintains a cache with all its downloads, so internet access should not be necessary. Then for installation, pip checks if the already existing packages fullfil the install dependencies (scipy and more). If not, again it will download them on the 1st build.

So pip needs internet of the 1st install. Normally not on next ones, but maybe it does other things I ignore.

Without internet access, the best way is to install from binaries, after copying all the necessary wheels (AT and its install dependencies) dowloaded or created on another machine with Internet access.

@swhite2401
Copy link
Contributor

@swhite2401: When building from source, pip works in a separate environment. That means that pip has to fill an empty environment with the build dependencies (setuptools, numpy and wheels). On the 1st build, it will download them. On the next runs, pip maintains a cache with all its downloads, so internet access should not be necessary. Then for installation, pip checks if the already existing packages fullfil the install dependencies (scipy and more). If not, again it will download them on the 1st build.

So pip needs internet of the 1st install. Normally not on next ones, but maybe it does other things I ignore.

Without internet access, the best way is to install from binaries, after copying all the necessary wheels (AT and its install dependencies) dowloaded or created on another machine with Internet access.

Well to be more precise I was working on the C in the train with no internet, so I have to rebuilt several times but could not because pip was looking for the dependencies. I tried the --no-deps flag without success.
Anyway, this is very specific and not so important, I just wanted to know whether there existed easy solutions for that... but it seems not

@lfarv
Copy link
Contributor Author

lfarv commented Oct 5, 2023

Is there any other remark on this? Otherwise could someone approve?

@lfarv lfarv requested a review from MJGaughran October 5, 2023 06:22
@lfarv lfarv merged commit 782c148 into master Oct 5, 2023
35 checks passed
@lfarv lfarv deleted the update_github_actions branch October 5, 2023 09:53
lnadolski added a commit that referenced this pull request Oct 25, 2023
# By Laurent Farvacque (14) and others
# Via GitHub
* master: (28 commits)
  Add passive beamloading cavity (#586)
  Create BndStrMPoleSymplectic4RadPass (#665)
  Documentation fixes (#669)
  Update of the build process (#659)
  New Matlab function atsimplering (#657)
  Collective bugfix (#664)
  Correct the attribute name of solenoids in Matlab (#663)
  Error parsing args for twiss_in and r_4d (#662)
  Fix atmaincavities (#656)
  Fix attribute names in Simple Ring (#655)
  Remove collective passes from internal lattice_pass (#650)
  The DPStep keyword in linopt6 raises an error for 4D lattices (#651)
  Bug fix in atdisable_6d: keep the Energy field in cavities. (#654)
  fix: ring phase advances in computeRDT.m (#652)
  Correct the axis definition in plot_sigma (#648)
  Don't automatically cache the location of RF cavities (#640)
  Simple ring model (#643)
  Correct Dipole tapering (#623)
  Chromatic functions extended (#644)
  Repair the Matlab tests (#645)
  ...

# Conflicts:
#	atmat/Contents.m
#	atmat/atphysics/Radiation/atdisable_6d.m
#	atmat/atphysics/Radiation/atenable_6d.m
#	atmat/lattice/at2str.m
#	atmat/pubtools/create_elems/atidtable_dat.m
#	pyat/at/lattice/elements.py
#	pyat/at/lattice/lattice_object.py
#	pyat/at/physics/matrix.py
#	pyat/at/physics/radiation.py
#	pyat/examples/CollectiveEffects/RobinsonInstability.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants